Class ImmutablePartialMutation.Builder
java.lang.Object
net.bmahe.genetics4j.core.spec.mutation.ImmutablePartialMutation.Builder
- Enclosing class:
ImmutablePartialMutation
@Generated(from="PartialMutation",
generator="Immutables")
public static final class ImmutablePartialMutation.Builder
extends Object
Builds instances of type
PartialMutation.
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 intprivate static final longprivate static final longprivate longprivate MutationPolicy -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbuild()Builds a newPartialMutation.chromosomeIndex(int chromosomeIndex) Initializes the value for thechromosomeIndexattribute.private Stringfrom(PartialMutation instance) Fill a builder with attribute values from the providedPartialMutationinstance.mutationPolicy(MutationPolicy mutationPolicy) Initializes the value for themutationPolicyattribute.
-
Field Details
-
INIT_BIT_CHROMOSOME_INDEX
private static final long INIT_BIT_CHROMOSOME_INDEX- See Also:
-
INIT_BIT_MUTATION_POLICY
private static final long INIT_BIT_MUTATION_POLICY- See Also:
-
initBits
private long initBits -
chromosomeIndex
private int chromosomeIndex -
mutationPolicy
-
-
Constructor Details
-
Builder
private Builder()
-
-
Method Details
-
from
Fill a builder with attribute values from the providedPartialMutationinstance. 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
-
chromosomeIndex
Initializes the value for thechromosomeIndexattribute.- Parameters:
chromosomeIndex- The value for chromosomeIndex- Returns:
thisbuilder for use in a chained invocation
-
mutationPolicy
Initializes the value for themutationPolicyattribute.- Parameters:
mutationPolicy- The value for mutationPolicy- Returns:
thisbuilder for use in a chained invocation
-
build
Builds a newPartialMutation.- Returns:
- An immutable instance of PartialMutation
- Throws:
IllegalStateException- if any required attributes are missing
-
formatRequiredAttributesMessage
-