Class ImmutableIntChromosomeSpec.Builder
java.lang.Object
net.bmahe.genetics4j.core.spec.chromosome.ImmutableIntChromosomeSpec.Builder
- Direct Known Subclasses:
IntChromosomeSpec.Builder
- Enclosing class:
ImmutableIntChromosomeSpec
@Generated(from="IntChromosomeSpec",
generator="Immutables")
public static class ImmutableIntChromosomeSpec.Builder
extends Object
Builds instances of type
IntChromosomeSpec.
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.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final longprivate static final longprivate static final longprivate longprivate intprivate intprivate int -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbuild()Builds a newIntChromosomeSpec.private Stringfrom(IntChromosomeSpec instance) Fill a builder with attribute values from the providedIntChromosomeSpecinstance.maxValue(int maxValue) Initializes the value for themaxValueattribute.minValue(int minValue) Initializes the value for theminValueattribute.size(int size) Initializes the value for thesizeattribute.
-
Field Details
-
INIT_BIT_SIZE
private static final long INIT_BIT_SIZE- See Also:
-
INIT_BIT_MIN_VALUE
private static final long INIT_BIT_MIN_VALUE- See Also:
-
INIT_BIT_MAX_VALUE
private static final long INIT_BIT_MAX_VALUE- See Also:
-
initBits
private long initBits -
size
private int size -
minValue
private int minValue -
maxValue
private int maxValue
-
-
Constructor Details
-
Builder
public Builder()Creates a builder forIntChromosomeSpecinstances.new IntChromosomeSpec.Builder() .size(int) // requiredsize.minValue(int) // requiredminValue.maxValue(int) // requiredmaxValue.build();
-
-
Method Details
-
from
Fill a builder with attribute values from the providedIntChromosomeSpecinstance. 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
-
size
Initializes the value for thesizeattribute.- Parameters:
size- The value for size- Returns:
thisbuilder for use in a chained invocation
-
minValue
Initializes the value for theminValueattribute.- Parameters:
minValue- The value for minValue- Returns:
thisbuilder for use in a chained invocation
-
maxValue
Initializes the value for themaxValueattribute.- Parameters:
maxValue- The value for maxValue- Returns:
thisbuilder for use in a chained invocation
-
build
Builds a newIntChromosomeSpec.- Returns:
- An immutable instance of IntChromosomeSpec
- Throws:
IllegalStateException- if any required attributes are missing
-
formatRequiredAttributesMessage
-