Class ImmutableInteractionType

    • Method Detail

      • isPairing

        public boolean isPairing()
        Checks if this interaction is a basis for base pairing.
        Specified by:
        isPairing in class InteractionType
        Returns:
        True for BASE_BASE, false for all other types.
      • withLeft

        public final ImmutableInteractionType withLeft​(NucleotideComponentType value)
        Copy the current immutable object by setting a value for the left attribute. A value equality check is used to prevent copying of the same value by returning this.
        Parameters:
        value - A new value for left
        Returns:
        A modified copy of the this object
      • withRight

        public final ImmutableInteractionType withRight​(NucleotideComponentType value)
        Copy the current immutable object by setting a value for the right attribute. A value equality check is used to prevent copying of the same value by returning this.
        Parameters:
        value - A new value for right
        Returns:
        A modified copy of the this object
      • withIsPairing

        public final ImmutableInteractionType withIsPairing​(boolean value)
        Copy the current immutable object by setting a value for the isPairing attribute. A value equality check is used to prevent copying of the same value by returning this.
        Parameters:
        value - A new value for isPairing
        Returns:
        A modified copy of the this object
      • withDescription

        public final ImmutableInteractionType withDescription​(String value)
        Copy the current immutable object by setting a value for the description attribute. An equals check used to prevent copying of the same value by returning this.
        Parameters:
        value - A new value for description
        Returns:
        A modified copy of the this object
      • equals

        public boolean equals​(@Nullable
                              Object another)
        This instance is equal to all instances of ImmutableInteractionType that have equal attribute values.
        Overrides:
        equals in class Object
        Returns:
        true if this is equal to another instance
      • hashCode

        public int hashCode()
        Computes a hash code from attributes: left, right, isPairing, description.
        Overrides:
        hashCode in class Object
        Returns:
        hashCode value
      • copyOf

        public static ImmutableInteractionType copyOf​(InteractionType instance)
        Creates an immutable copy of a InteractionType value. Uses accessors to get values to initialize the new immutable instance. If an instance is already immutable, it is returned as is.
        Parameters:
        instance - The instance to copy
        Returns:
        A copied immutable InteractionType instance
      • builder

        public static ImmutableInteractionType.Builder builder()
        Creates a builder for ImmutableInteractionType.
         ImmutableInteractionType.builder()
            .left(pl.poznan.put.rna.NucleotideComponentType) // required left
            .right(pl.poznan.put.rna.NucleotideComponentType) // required right
            .isPairing(boolean) // required isPairing
            .description(String) // optional description
            .build();
         
        Returns:
        A new ImmutableInteractionType builder