Package pl.poznan.put.pdb.analysis
Class ImmutableDefaultResidueCollection.Builder
java.lang.Object
pl.poznan.put.pdb.analysis.ImmutableDefaultResidueCollection.Builder
- Enclosing class:
- ImmutableDefaultResidueCollection
Builds instances of type
ImmutableDefaultResidueCollection.
Initialize attributes and then invoke the build() method to create an
immutable instance.
Builder is not thread-safe and generally should not be stored in a field or collection,
but instead used immediately to create instances.
-
Method Summary
Modifier and TypeMethodDescriptionaddAllResidues(Iterable<? extends PdbResidue> elements) Adds elements toresidueslist.addResidues(PdbResidue element) Adds one element toresidueslist.addResidues(PdbResidue... elements) Adds elements toresidueslist.build()Builds a newImmutableDefaultResidueCollection.from(DefaultResidueCollection instance) Fill a builder with attribute values from the providedpl.poznan.put.pdb.analysis.DefaultResidueCollectioninstance.from(ResidueCollection instance) Fill a builder with attribute values from the providedpl.poznan.put.pdb.analysis.ResidueCollectioninstance.residues(Iterable<? extends PdbResidue> elements) Sets or replaces all elements forresidueslist.
-
Method Details
-
from
Fill a builder with attribute values from the providedpl.poznan.put.pdb.analysis.ResidueCollectioninstance.- Parameters:
instance- The instance from which to copy values- Returns:
thisbuilder for use in a chained invocation
-
from
Fill a builder with attribute values from the providedpl.poznan.put.pdb.analysis.DefaultResidueCollectioninstance.- Parameters:
instance- The instance from which to copy values- Returns:
thisbuilder for use in a chained invocation
-
addResidues
Adds one element toresidueslist.- Parameters:
element- A residues element- Returns:
thisbuilder for use in a chained invocation
-
addResidues
Adds elements toresidueslist.- Parameters:
elements- An array of residues elements- Returns:
thisbuilder for use in a chained invocation
-
residues
public final ImmutableDefaultResidueCollection.Builder residues(Iterable<? extends PdbResidue> elements) Sets or replaces all elements forresidueslist.- Parameters:
elements- An iterable of residues elements- Returns:
thisbuilder for use in a chained invocation
-
addAllResidues
public final ImmutableDefaultResidueCollection.Builder addAllResidues(Iterable<? extends PdbResidue> elements) Adds elements toresidueslist.- Parameters:
elements- An iterable of residues elements- Returns:
thisbuilder for use in a chained invocation
-
build
Builds a newImmutableDefaultResidueCollection.- Returns:
- An immutable instance of DefaultResidueCollection
- Throws:
IllegalStateException- if any required attributes are missing
-