Class ImmutablePdbResidueIdentifier

java.lang.Object
pl.poznan.put.pdb.PdbResidueIdentifier
pl.poznan.put.pdb.ImmutablePdbResidueIdentifier
All Implemented Interfaces:
Serializable, Comparable<ChainNumberICode>, ChainNumberICode

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

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

See Also:
  • Method Details

    • chainIdentifier

      public String chainIdentifier()
      Specified by:
      chainIdentifier in interface ChainNumberICode
      Specified by:
      chainIdentifier in class PdbResidueIdentifier
      Returns:
      The value of the chainIdentifier attribute
    • residueNumber

      public int residueNumber()
      Specified by:
      residueNumber in interface ChainNumberICode
      Specified by:
      residueNumber in class PdbResidueIdentifier
      Returns:
      The value of the residueNumber attribute
    • insertionCode

      public Optional<String> insertionCode()
      Specified by:
      insertionCode in interface ChainNumberICode
      Specified by:
      insertionCode in class PdbResidueIdentifier
      Returns:
      The value of the insertionCode attribute
    • withChainIdentifier

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

      public final ImmutablePdbResidueIdentifier withResidueNumber(int value)
      Copy the current immutable object by setting a value for the residueNumber attribute. A value equality check is used to prevent copying of the same value by returning this.
      Parameters:
      value - A new value for residueNumber
      Returns:
      A modified copy of the this object
    • withInsertionCode

      public final ImmutablePdbResidueIdentifier withInsertionCode(String value)
      Copy the current immutable object by setting a present value for the optional insertionCode attribute.
      Parameters:
      value - The value for insertionCode
      Returns:
      A modified copy of this object
    • withInsertionCode

      public final ImmutablePdbResidueIdentifier withInsertionCode(Optional<String> optional)
      Copy the current immutable object by setting an optional value for the insertionCode attribute. An equality check is used on inner nullable value to prevent copying of the same value by returning this.
      Parameters:
      optional - A value for insertionCode
      Returns:
      A modified copy of this object
    • equals

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

      public static ImmutablePdbResidueIdentifier of(String chainIdentifier, int residueNumber, Optional<String> insertionCode)
      Construct a new immutable PdbResidueIdentifier instance.
      Parameters:
      chainIdentifier - The value for the chainIdentifier attribute
      residueNumber - The value for the residueNumber attribute
      insertionCode - The value for the insertionCode attribute
      Returns:
      An immutable PdbResidueIdentifier instance
    • copyOf

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

      public static ImmutablePdbResidueIdentifier.Builder builder()
      Creates a builder for ImmutablePdbResidueIdentifier.
       ImmutablePdbResidueIdentifier.builder()
          .chainIdentifier(String) // required chainIdentifier
          .residueNumber(int) // required residueNumber
          .insertionCode(String) // optional insertionCode
          .build();
       
      Returns:
      A new ImmutablePdbResidueIdentifier builder