Class ImmutablePdbNamedResidueIdentifier

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

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

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

See Also:
  • Method Details

    • chainIdentifier

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

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

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

      public char oneLetterName()
      Specified by:
      oneLetterName in class PdbNamedResidueIdentifier
      Returns:
      The one letter name of the residue.
    • withChainIdentifier

      public final ImmutablePdbNamedResidueIdentifier 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 ImmutablePdbNamedResidueIdentifier 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 ImmutablePdbNamedResidueIdentifier 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 ImmutablePdbNamedResidueIdentifier 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
    • withOneLetterName

      public final ImmutablePdbNamedResidueIdentifier withOneLetterName(char value)
      Copy the current immutable object by setting a value for the oneLetterName attribute. A value equality check is used to prevent copying of the same value by returning this.
      Parameters:
      value - A new value for oneLetterName
      Returns:
      A modified copy of the this object
    • equals

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

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

      Creates an immutable copy of a PdbNamedResidueIdentifier 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 PdbNamedResidueIdentifier instance
    • builder

      Creates a builder for ImmutablePdbNamedResidueIdentifier.
       ImmutablePdbNamedResidueIdentifier.builder()
          .chainIdentifier(String) // required chainIdentifier
          .residueNumber(int) // required residueNumber
          .insertionCode(String) // optional insertionCode
          .oneLetterName(char) // required oneLetterName
          .build();
       
      Returns:
      A new ImmutablePdbNamedResidueIdentifier builder