Class ImmutableRandomMutation
java.lang.Object
net.bmahe.genetics4j.core.spec.mutation.RandomMutation
net.bmahe.genetics4j.core.spec.mutation.ImmutableRandomMutation
- All Implemented Interfaces:
MutationPolicy
@Generated(from="RandomMutation",
generator="Immutables")
@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
Nested Classes -
Field Summary
Fields -
Constructor Summary
ConstructorsModifierConstructorDescriptionprivateImmutableRandomMutation(double populationMutationProbability) -
Method Summary
Modifier and TypeMethodDescriptionbuilder()Creates a builder forRandomMutation.static RandomMutationcopyOf(RandomMutation instance) Creates an immutable copy of aRandomMutationvalue.booleanThis instance is equal to all instances ofImmutableRandomMutationthat have equal attribute values.private booleanequalsByValue(ImmutableRandomMutation another) inthashCode()Computes a hash code from attributes:populationMutationProbability.static RandomMutationof(double populationMutationProbability) Construct a new immutableRandomMutationinstance.doubletoString()Prints the immutable valueRandomMutationwith attribute values.private static ImmutableRandomMutationvalidate(ImmutableRandomMutation instance) final ImmutableRandomMutationwithPopulationMutationProbability(double value) Copy the current immutable object by setting a value for thepopulationMutationProbabilityattribute.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:
populationMutationProbabilityin classRandomMutation- Returns:
- The value of the
populationMutationProbabilityattribute
-
withPopulationMutationProbability
Copy the current immutable object by setting a value for thepopulationMutationProbabilityattribute. 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 or the
thisobject
-
equals
This instance is equal to all instances ofImmutableRandomMutationthat have equal attribute values. -
equalsByValue
-
hashCode
public int hashCode()Computes a hash code from attributes:populationMutationProbability. -
toString
Prints the immutable valueRandomMutationwith attribute values. -
of
Construct a new immutableRandomMutationinstance.- Parameters:
populationMutationProbability- The value for thepopulationMutationProbabilityattribute- Returns:
- An immutable RandomMutation instance
-
validate
-
copyOf
Creates an immutable copy of aRandomMutationvalue. 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 forRandomMutation.ImmutableRandomMutation.builder() .populationMutationProbability(double) // requiredpopulationMutationProbability.build();- Returns:
- A new RandomMutation builder
-