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 theavgattribute.build()Builds a newImmutableBondLength.from(BondLength instance) Fill a builder with attribute values from the providedBondLengthinstance.max(double max) Initializes the value for themaxattribute.min(double min) Initializes the value for theminattribute.
-
Method Details
-
from
Fill a builder with attribute values from the providedBondLengthinstance. 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:
thisbuilder for use in a chained invocation
-
min
Initializes the value for theminattribute.- Parameters:
min- The value for min- Returns:
thisbuilder for use in a chained invocation
-
max
Initializes the value for themaxattribute.- Parameters:
max- The value for max- Returns:
thisbuilder for use in a chained invocation
-
avg
Initializes the value for theavgattribute.- Parameters:
avg- The value for avg- Returns:
thisbuilder for use in a chained invocation
-
build
Builds a newImmutableBondLength.- Returns:
- An immutable instance of BondLength
- Throws:
IllegalStateException- if any required attributes are missing
-