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 toresidues
list.addResidues
(PdbResidue element) Adds one element toresidues
list.addResidues
(PdbResidue... elements) Adds elements toresidues
list.build()
Builds a newImmutableDefaultResidueCollection
.from
(DefaultResidueCollection instance) Fill a builder with attribute values from the providedpl.poznan.put.pdb.analysis.DefaultResidueCollection
instance.from
(ResidueCollection instance) Fill a builder with attribute values from the providedpl.poznan.put.pdb.analysis.ResidueCollection
instance.residues
(Iterable<? extends PdbResidue> elements) Sets or replaces all elements forresidues
list.
-
Method Details
-
from
Fill a builder with attribute values from the providedpl.poznan.put.pdb.analysis.ResidueCollection
instance.- Parameters:
instance
- The instance from which to copy values- Returns:
this
builder for use in a chained invocation
-
from
Fill a builder with attribute values from the providedpl.poznan.put.pdb.analysis.DefaultResidueCollection
instance.- Parameters:
instance
- The instance from which to copy values- Returns:
this
builder for use in a chained invocation
-
addResidues
Adds one element toresidues
list.- Parameters:
element
- A residues element- Returns:
this
builder for use in a chained invocation
-
addResidues
Adds elements toresidues
list.- Parameters:
elements
- An array of residues elements- Returns:
this
builder for use in a chained invocation
-
residues
public final ImmutableDefaultResidueCollection.Builder residues(Iterable<? extends PdbResidue> elements) Sets or replaces all elements forresidues
list.- Parameters:
elements
- An iterable of residues elements- Returns:
this
builder for use in a chained invocation
-
addAllResidues
public final ImmutableDefaultResidueCollection.Builder addAllResidues(Iterable<? extends PdbResidue> elements) Adds elements toresidues
list.- Parameters:
elements
- An iterable of residues elements- Returns:
this
builder for use in a chained invocation
-
build
Builds a newImmutableDefaultResidueCollection
.- Returns:
- An immutable instance of DefaultResidueCollection
- Throws:
IllegalStateException
- if any required attributes are missing
-