Class ImmutableBasePair

java.lang.Object
pl.poznan.put.structure.BasePair
pl.poznan.put.structure.ImmutableBasePair
All Implemented Interfaces:
Serializable, Comparable<BasePair>

@ParametersAreNonnullByDefault @Generated("org.immutables.processor.ProxyProcessor") @Immutable public final class ImmutableBasePair extends BasePair
Immutable implementation of BasePair.

Use the builder to create immutable instances: ImmutableBasePair.builder(). Use the static factory method to create immutable instances: ImmutableBasePair.of().

See Also:
  • Method Details

    • left

      Specified by:
      left in class BasePair
      Returns:
      The first residue.
    • right

      public PdbNamedResidueIdentifier right()
      Specified by:
      right in class BasePair
      Returns:
      The second residue.
    • withLeft

      public final ImmutableBasePair withLeft(PdbNamedResidueIdentifier value)
      Copy the current immutable object by setting a value for the left attribute. A shallow reference 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 ImmutableBasePair withRight(PdbNamedResidueIdentifier value)
      Copy the current immutable object by setting a value for the right attribute. A shallow reference 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
    • equals

      public boolean equals(@Nullable Object another)
      This instance is equal to all instances of ImmutableBasePair 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.
      Overrides:
      hashCode in class Object
      Returns:
      hashCode value
    • of

      Construct a new immutable BasePair instance.
      Parameters:
      left - The value for the left attribute
      right - The value for the right attribute
      Returns:
      An immutable BasePair instance
    • copyOf

      public static ImmutableBasePair copyOf(BasePair instance)
      Creates an immutable copy of a BasePair 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 BasePair instance
    • builder

      public static ImmutableBasePair.Builder builder()
      Creates a builder for ImmutableBasePair.
       ImmutableBasePair.builder()
          .left(pl.poznan.put.pdb.PdbNamedResidueIdentifier) // required left
          .right(pl.poznan.put.pdb.PdbNamedResidueIdentifier) // required right
          .build();
       
      Returns:
      A new ImmutableBasePair builder