Package pl.poznan.put.atom
Class ImmutableBondLength.Builder
java.lang.Object
pl.poznan.put.atom.ImmutableBondLength.Builder
- Enclosing class:
- ImmutableBondLength
Builds instances of type
ImmutableBondLength
.
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 TypeMethodDescriptionavg
(double avg) Initializes the value for theavg
attribute.build()
Builds a newImmutableBondLength
.from
(BondLength instance) Fill a builder with attribute values from the providedBondLength
instance.max
(double max) Initializes the value for themax
attribute.min
(double min) Initializes the value for themin
attribute.
-
Method Details
-
from
Fill a builder with attribute values from the providedBondLength
instance. Regular attribute values will be replaced with those from the given instance. Absent optional values will not replace present values.- Parameters:
instance
- The instance from which to copy values- Returns:
this
builder for use in a chained invocation
-
min
Initializes the value for themin
attribute.- Parameters:
min
- The value for min- Returns:
this
builder for use in a chained invocation
-
max
Initializes the value for themax
attribute.- Parameters:
max
- The value for max- Returns:
this
builder for use in a chained invocation
-
avg
Initializes the value for theavg
attribute.- Parameters:
avg
- The value for avg- Returns:
this
builder for use in a chained invocation
-
build
Builds a newImmutableBondLength
.- Returns:
- An immutable instance of BondLength
- Throws:
IllegalStateException
- if any required attributes are missing
-