Package pl.poznan.put.external.dssr
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 ofNucleotide.Use the builder to create immutable instances:
ImmutableNucleotide.builder().
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classImmutableNucleotide.BuilderBuilds instances of typeImmutableNucleotide.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static ImmutableNucleotide.Builderbuilder()Creates a builder forImmutableNucleotide.StringchainName()static ImmutableNucleotidecopyOf(Nucleotide instance)Creates an immutable copy of aNucleotidevalue.booleanequals(Object another)This instance is equal to all instances ofImmutableNucleotidethat have equal attribute values.inthashCode()Computes a hash code from attributes:id,chainName,oneLetterName,residueNumber.Stringid()StringoneLetterName()intresidueNumber()StringtoString()Prints the immutable valueNucleotidewith attribute values.ImmutableNucleotidewithChainName(String value)Copy the current immutable object by setting a value for thechainNameattribute.ImmutableNucleotidewithId(String value)Copy the current immutable object by setting a value for theidattribute.ImmutableNucleotidewithOneLetterName(String value)Copy the current immutable object by setting a value for theoneLetterNameattribute.ImmutableNucleotidewithResidueNumber(int value)Copy the current immutable object by setting a value for theresidueNumberattribute.-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface pl.poznan.put.external.dssr.Nucleotide
toNamedResidueIdentifer
-
-
-
-
Method Detail
-
id
public String id()
- Specified by:
idin interfaceNucleotide- Returns:
- The value of the
idattribute
-
chainName
public String chainName()
- Specified by:
chainNamein interfaceNucleotide- Returns:
- The value of the
chainNameattribute
-
oneLetterName
public String oneLetterName()
- Specified by:
oneLetterNamein interfaceNucleotide- Returns:
- The value of the
oneLetterNameattribute
-
residueNumber
public int residueNumber()
- Specified by:
residueNumberin interfaceNucleotide- Returns:
- The value of the
residueNumberattribute
-
withId
public final ImmutableNucleotide withId(String value)
Copy the current immutable object by setting a value for theidattribute. An equals check used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for id- Returns:
- A modified copy of the
thisobject
-
withChainName
public final ImmutableNucleotide withChainName(String value)
Copy the current immutable object by setting a value for thechainNameattribute. An equals check used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for chainName- Returns:
- A modified copy of the
thisobject
-
withOneLetterName
public final ImmutableNucleotide withOneLetterName(String value)
Copy the current immutable object by setting a value for theoneLetterNameattribute. An equals check used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for oneLetterName- Returns:
- A modified copy of the
thisobject
-
withResidueNumber
public final ImmutableNucleotide withResidueNumber(int value)
Copy the current immutable object by setting a value for theresidueNumberattribute. A value equality check is used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for residueNumber- Returns:
- A modified copy of the
thisobject
-
equals
public boolean equals(@Nullable Object another)
This instance is equal to all instances ofImmutableNucleotidethat have equal attribute values.
-
hashCode
public int hashCode()
Computes a hash code from attributes:id,chainName,oneLetterName,residueNumber.
-
toString
public String toString()
Prints the immutable valueNucleotidewith attribute values.
-
copyOf
public static ImmutableNucleotide copyOf(Nucleotide instance)
Creates an immutable copy of aNucleotidevalue. 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 forImmutableNucleotide.ImmutableNucleotide.builder() .id(String) // requiredid.chainName(String) // requiredchainName.oneLetterName(String) // requiredoneLetterName.residueNumber(int) // requiredresidueNumber.build();- Returns:
- A new ImmutableNucleotide builder
-
-