Package pl.poznan.put.atom
Class ImmutableBondLength.Builder
- java.lang.Object
-
- pl.poznan.put.atom.ImmutableBondLength.Builder
-
- Enclosing class:
- ImmutableBondLength
@NotThreadSafe public static final class ImmutableBondLength.Builder extends Object
Builds instances of typeImmutableBondLength. Initialize attributes and then invoke thebuild()method to create an immutable instance.Builderis not thread-safe and generally should not be stored in a field or collection, but instead used immediately to create instances.
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ImmutableBondLength.Builderavg(double avg)Initializes the value for theavgattribute.ImmutableBondLengthbuild()Builds a newImmutableBondLength.ImmutableBondLength.Builderfrom(BondLength instance)Fill a builder with attribute values from the providedBondLengthinstance.ImmutableBondLength.Buildermax(double max)Initializes the value for themaxattribute.ImmutableBondLength.Buildermin(double min)Initializes the value for theminattribute.
-
-
-
Method Detail
-
from
public final ImmutableBondLength.Builder from(BondLength instance)
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
public final ImmutableBondLength.Builder min(double min)
Initializes the value for theminattribute.- Parameters:
min- The value for min- Returns:
thisbuilder for use in a chained invocation
-
max
public final ImmutableBondLength.Builder max(double max)
Initializes the value for themaxattribute.- Parameters:
max- The value for max- Returns:
thisbuilder for use in a chained invocation
-
avg
public final ImmutableBondLength.Builder avg(double avg)
Initializes the value for theavgattribute.- Parameters:
avg- The value for avg- Returns:
thisbuilder for use in a chained invocation
-
build
public ImmutableBondLength build()
Builds a newImmutableBondLength.- Returns:
- An immutable instance of BondLength
- Throws:
IllegalStateException- if any required attributes are missing
-
-