Class ImmutableRandomMutation
java.lang.Object
net.bmahe.genetics4j.core.spec.mutation.RandomMutation
net.bmahe.genetics4j.core.spec.mutation.ImmutableRandomMutation
- All Implemented Interfaces:
MutationPolicy
@Generated("org.immutables.processor.ProxyProcessor")
public final class ImmutableRandomMutation
extends RandomMutation
Immutable implementation of
RandomMutation
.
Use the builder to create immutable instances:
ImmutableRandomMutation.builder()
.
Use the static factory method to create immutable instances:
ImmutableRandomMutation.of()
.
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic final class
Builds instances of typeImmutableRandomMutation
. -
Field Summary
-
Constructor Summary
ModifierConstructorDescriptionprivate
ImmutableRandomMutation
(double populationMutationProbability) -
Method Summary
Modifier and TypeMethodDescriptionbuilder()
Creates a builder forImmutableRandomMutation
.static ImmutableRandomMutation
copyOf
(RandomMutation instance) Creates an immutable copy of aRandomMutation
value.boolean
This instance is equal to all instances ofImmutableRandomMutation
that have equal attribute values.private boolean
equalTo
(int synthetic, ImmutableRandomMutation another) int
hashCode()
Computes a hash code from attributes:populationMutationProbability
.static ImmutableRandomMutation
of
(double populationMutationProbability) Construct a new immutableRandomMutation
instance.double
toString()
Prints the immutable valueRandomMutation
with attribute values.private static ImmutableRandomMutation
validate
(ImmutableRandomMutation instance) final ImmutableRandomMutation
withPopulationMutationProbability
(double value) Copy the current immutable object by setting a value for thepopulationMutationProbability
attribute.Methods inherited from class net.bmahe.genetics4j.core.spec.mutation.RandomMutation
check
-
Field Details
-
populationMutationProbability
private final double populationMutationProbability
-
-
Constructor Details
-
ImmutableRandomMutation
private ImmutableRandomMutation(double populationMutationProbability)
-
-
Method Details
-
populationMutationProbability
public double populationMutationProbability()- Specified by:
populationMutationProbability
in classRandomMutation
- Returns:
- The value of the
populationMutationProbability
attribute
-
withPopulationMutationProbability
Copy the current immutable object by setting a value for thepopulationMutationProbability
attribute. A value strict bits equality used to prevent copying of the same value by returningthis
.- Parameters:
value
- A new value for populationMutationProbability- Returns:
- A modified copy of the
this
object
-
equals
This instance is equal to all instances ofImmutableRandomMutation
that have equal attribute values. -
equalTo
-
hashCode
public int hashCode()Computes a hash code from attributes:populationMutationProbability
. -
toString
Prints the immutable valueRandomMutation
with attribute values. -
of
Construct a new immutableRandomMutation
instance.- Parameters:
populationMutationProbability
- The value for thepopulationMutationProbability
attribute- Returns:
- An immutable RandomMutation instance
-
validate
-
copyOf
Creates an immutable copy of aRandomMutation
value. Uses accessors to get values to initialize the new immutable instance. If an instance is already immutable, it is returned as is.- Parameters:
instance
- The instance to copy- Returns:
- A copied immutable RandomMutation instance
-
builder
Creates a builder forImmutableRandomMutation
.ImmutableRandomMutation.builder() .populationMutationProbability(double) // required
populationMutationProbability
.build();- Returns:
- A new ImmutableRandomMutation builder
-