Class ImmutableSwitchStateMutation
java.lang.Object
net.bmahe.genetics4j.neat.spec.mutation.SwitchStateMutation
net.bmahe.genetics4j.neat.spec.mutation.ImmutableSwitchStateMutation
- All Implemented Interfaces:
MutationPolicy
@Generated(from="SwitchStateMutation",
generator="Immutables")
@Generated("org.immutables.processor.ProxyProcessor")
public final class ImmutableSwitchStateMutation
extends SwitchStateMutation
Immutable implementation of
SwitchStateMutation.
Use the builder to create immutable instances:
ImmutableSwitchStateMutation.builder().
Use the static factory method to create immutable instances:
ImmutableSwitchStateMutation.of().
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final classBuilds instances of typeSwitchStateMutation. -
Field Summary
Fields -
Constructor Summary
ConstructorsModifierConstructorDescriptionprivateImmutableSwitchStateMutation(double populationMutationProbability) -
Method Summary
Modifier and TypeMethodDescriptionbuilder()Creates a builder forSwitchStateMutation.static SwitchStateMutationcopyOf(SwitchStateMutation instance) Creates an immutable copy of aSwitchStateMutationvalue.booleanThis instance is equal to all instances ofImmutableSwitchStateMutationthat have equal attribute values.private booleaninthashCode()Computes a hash code from attributes:populationMutationProbability.static SwitchStateMutationof(double populationMutationProbability) Construct a new immutableSwitchStateMutationinstance.doubletoString()Prints the immutable valueSwitchStateMutationwith attribute values.private static ImmutableSwitchStateMutationvalidate(ImmutableSwitchStateMutation instance) withPopulationMutationProbability(double value) Copy the current immutable object by setting a value for thepopulationMutationProbabilityattribute.Methods inherited from class net.bmahe.genetics4j.neat.spec.mutation.SwitchStateMutation
check
-
Field Details
-
populationMutationProbability
private final double populationMutationProbability
-
-
Constructor Details
-
ImmutableSwitchStateMutation
private ImmutableSwitchStateMutation(double populationMutationProbability)
-
-
Method Details
-
populationMutationProbability
public double populationMutationProbability()- Specified by:
populationMutationProbabilityin classSwitchStateMutation- 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 ofImmutableSwitchStateMutationthat have equal attribute values. -
equalsByValue
-
hashCode
public int hashCode()Computes a hash code from attributes:populationMutationProbability. -
toString
Prints the immutable valueSwitchStateMutationwith attribute values. -
of
Construct a new immutableSwitchStateMutationinstance.- Parameters:
populationMutationProbability- The value for thepopulationMutationProbabilityattribute- Returns:
- An immutable SwitchStateMutation instance
-
validate
-
copyOf
Creates an immutable copy of aSwitchStateMutationvalue. 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 SwitchStateMutation instance
-
builder
Creates a builder forSwitchStateMutation.ImmutableSwitchStateMutation.builder() .populationMutationProbability(double) // requiredpopulationMutationProbability.build();- Returns:
- A new SwitchStateMutation builder
-