Class ImmutableNucleotide

java.lang.Object
pl.poznan.put.external.dssr.ImmutableNucleotide
All Implemented Interfaces:
Nucleotide

@ParametersAreNonnullByDefault @Generated("org.immutables.processor.ProxyProcessor") @Immutable public final class ImmutableNucleotide extends Object implements Nucleotide
Immutable implementation of Nucleotide.

Use the builder to create immutable instances: ImmutableNucleotide.builder().

  • Method Details

    • id

      public String id()
      Specified by:
      id in interface Nucleotide
      Returns:
      The value of the id attribute
    • chainName

      public String chainName()
      Specified by:
      chainName in interface Nucleotide
      Returns:
      The value of the chainName attribute
    • oneLetterName

      public String oneLetterName()
      Specified by:
      oneLetterName in interface Nucleotide
      Returns:
      The value of the oneLetterName attribute
    • residueNumber

      public int residueNumber()
      Specified by:
      residueNumber in interface Nucleotide
      Returns:
      The value of the residueNumber attribute
    • withId

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

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

      public final ImmutableNucleotide withOneLetterName(String value)
      Copy the current immutable object by setting a value for the oneLetterName attribute. An equals check 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
    • withResidueNumber

      public final ImmutableNucleotide 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
    • equals

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

      public String toString()
      Prints the immutable value Nucleotide with attribute values.
      Overrides:
      toString in class Object
      Returns:
      A string representation of the value
    • copyOf

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

      public static ImmutableNucleotide.Builder builder()
      Creates a builder for ImmutableNucleotide.
       ImmutableNucleotide.builder()
          .id(String) // required id
          .chainName(String) // required chainName
          .oneLetterName(String) // required oneLetterName
          .residueNumber(int) // required residueNumber
          .build();
       
      Returns:
      A new ImmutableNucleotide builder