Package pl.poznan.put.pdb.analysis
Class ImmutablePdbChain
- java.lang.Object
-
- pl.poznan.put.pdb.analysis.PdbChain
-
- pl.poznan.put.pdb.analysis.ImmutablePdbChain
-
- All Implemented Interfaces:
Serializable,Comparable<PdbChain>,ResidueCollection,SingleTypedResidueCollection
@ParametersAreNonnullByDefault @Generated("org.immutables.processor.ProxyProcessor") @Immutable public final class ImmutablePdbChain extends PdbChain
Immutable implementation ofPdbChain.Use the builder to create immutable instances:
ImmutablePdbChain.builder(). Use the static factory method to create immutable instances:ImmutablePdbChain.of().- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classImmutablePdbChain.BuilderBuilds instances of typeImmutablePdbChain.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static ImmutablePdbChain.Builderbuilder()Creates a builder forImmutablePdbChain.static ImmutablePdbChaincopyOf(PdbChain instance)Creates an immutable copy of aPdbChainvalue.booleanequals(Object another)This instance is equal to all instances ofImmutablePdbChainthat have equal attribute values.inthashCode()Computes a hash code from attributes:identifier,residues.Stringidentifier()static ImmutablePdbChainof(String identifier, Iterable<? extends PdbResidue> residues)Construct a new immutablePdbChaininstance.static ImmutablePdbChainof(String identifier, List<PdbResidue> residues)Construct a new immutablePdbChaininstance.List<PdbResidue>residues()StringtoString()Prints the immutable valuePdbChainwith attribute values.ImmutablePdbChainwithIdentifier(String value)Copy the current immutable object by setting a value for theidentifierattribute.ImmutablePdbChainwithResidues(Iterable<? extends PdbResidue> elements)Copy the current immutable object with elements that replace the content ofresidues.ImmutablePdbChainwithResidues(PdbResidue... elements)Copy the current immutable object with elements that replace the content ofresidues.-
Methods inherited from class pl.poznan.put.pdb.analysis.PdbChain
compareTo, fromBioJavaChain
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface pl.poznan.put.pdb.analysis.ResidueCollection
filteredAtoms, findBondLengthViolations, findResidue, hasResidue, indexOf, namedResidueIdentifiers, residueIdentifiers, sequence, toCif, toPdb, withoutAlternateLocations
-
Methods inherited from interface pl.poznan.put.pdb.analysis.SingleTypedResidueCollection
moleculeType
-
-
-
-
Method Detail
-
identifier
public String identifier()
- Specified by:
identifierin classPdbChain- Returns:
- The chain identifier.
-
residues
public List<PdbResidue> residues()
- Specified by:
residuesin interfaceResidueCollection- Specified by:
residuesin classPdbChain- Returns:
- The value of the
residuesattribute
-
withIdentifier
public final ImmutablePdbChain withIdentifier(String value)
Copy the current immutable object by setting a value for theidentifierattribute. An equals check used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for identifier- Returns:
- A modified copy of the
thisobject
-
withResidues
public final ImmutablePdbChain withResidues(PdbResidue... elements)
Copy the current immutable object with elements that replace the content ofresidues.- Parameters:
elements- The elements to set- Returns:
- A modified copy of
thisobject
-
withResidues
public final ImmutablePdbChain withResidues(Iterable<? extends PdbResidue> elements)
Copy the current immutable object with elements that replace the content ofresidues. A shallow reference equality check is used to prevent copying of the same value by returningthis.- Parameters:
elements- An iterable of residues elements to set- Returns:
- A modified copy of
thisobject
-
equals
public boolean equals(@Nullable Object another)
This instance is equal to all instances ofImmutablePdbChainthat have equal attribute values.
-
hashCode
public int hashCode()
Computes a hash code from attributes:identifier,residues.
-
toString
public String toString()
Prints the immutable valuePdbChainwith attribute values.
-
of
public static ImmutablePdbChain of(String identifier, List<PdbResidue> residues)
Construct a new immutablePdbChaininstance.- Parameters:
identifier- The value for theidentifierattributeresidues- The value for theresiduesattribute- Returns:
- An immutable PdbChain instance
-
of
public static ImmutablePdbChain of(String identifier, Iterable<? extends PdbResidue> residues)
Construct a new immutablePdbChaininstance.- Parameters:
identifier- The value for theidentifierattributeresidues- The value for theresiduesattribute- Returns:
- An immutable PdbChain instance
-
copyOf
public static ImmutablePdbChain copyOf(PdbChain instance)
Creates an immutable copy of aPdbChainvalue. 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 PdbChain instance
-
builder
public static ImmutablePdbChain.Builder builder()
Creates a builder forImmutablePdbChain.ImmutablePdbChain.builder() .identifier(String) // requiredidentifier.addResidues|addAllResidues(pl.poznan.put.pdb.analysis.PdbResidue) //residueselements .build();- Returns:
- A new ImmutablePdbChain builder
-
-