Package pl.poznan.put.pdb.analysis
Class ImmutableResidueTorsionAngles.Builder
java.lang.Object
pl.poznan.put.pdb.analysis.ImmutableResidueTorsionAngles.Builder
- Enclosing class:
- ImmutableResidueTorsionAngles
Builds instances of type
ImmutableResidueTorsionAngles
.
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 TypeMethodDescriptionaddAllValues
(Iterable<? extends TorsionAngleValue> elements) Adds elements tovalues
list.addValues
(TorsionAngleValue element) Adds one element tovalues
list.addValues
(TorsionAngleValue... elements) Adds elements tovalues
list.build()
Builds a newImmutableResidueTorsionAngles
.from
(ResidueTorsionAngles instance) Fill a builder with attribute values from the providedResidueTorsionAngles
instance.identifier
(PdbResidueIdentifier identifier) Initializes the value for theidentifier
attribute.values
(Iterable<? extends TorsionAngleValue> elements) Sets or replaces all elements forvalues
list.
-
Method Details
-
from
Fill a builder with attribute values from the providedResidueTorsionAngles
instance. Regular attribute values will be replaced with those from the given instance. Absent optional values will not replace present values. Collection elements and entries will be added, not replaced.- Parameters:
instance
- The instance from which to copy values- Returns:
this
builder for use in a chained invocation
-
identifier
Initializes the value for theidentifier
attribute.- Parameters:
identifier
- The value for identifier- Returns:
this
builder for use in a chained invocation
-
addValues
Adds one element tovalues
list.- Parameters:
element
- A values element- Returns:
this
builder for use in a chained invocation
-
addValues
Adds elements tovalues
list.- Parameters:
elements
- An array of values elements- Returns:
this
builder for use in a chained invocation
-
values
public final ImmutableResidueTorsionAngles.Builder values(Iterable<? extends TorsionAngleValue> elements) Sets or replaces all elements forvalues
list.- Parameters:
elements
- An iterable of values elements- Returns:
this
builder for use in a chained invocation
-
addAllValues
public final ImmutableResidueTorsionAngles.Builder addAllValues(Iterable<? extends TorsionAngleValue> elements) Adds elements tovalues
list.- Parameters:
elements
- An iterable of values elements- Returns:
this
builder for use in a chained invocation
-
build
Builds a newImmutableResidueTorsionAngles
.- Returns:
- An immutable instance of ResidueTorsionAngles
- Throws:
IllegalStateException
- if any required attributes are missing
-