Class ImmutableMultiPointCrossover
java.lang.Object
net.bmahe.genetics4j.core.spec.combination.MultiPointCrossover
net.bmahe.genetics4j.core.spec.combination.ImmutableMultiPointCrossover
- All Implemented Interfaces:
CombinationPolicy
@Generated(from="MultiPointCrossover",
generator="Immutables")
@Generated("org.immutables.processor.ProxyProcessor")
public final class ImmutableMultiPointCrossover
extends MultiPointCrossover
Immutable implementation of
MultiPointCrossover.
Use the builder to create immutable instances:
ImmutableMultiPointCrossover.builder().
Use the static factory method to create immutable instances:
ImmutableMultiPointCrossover.of().
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final classBuilds instances of typeMultiPointCrossover. -
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbuilder()Creates a builder forMultiPointCrossover.static MultiPointCrossovercopyOf(MultiPointCrossover instance) Creates an immutable copy of aMultiPointCrossovervalue.booleanThis instance is equal to all instances ofImmutableMultiPointCrossoverthat have equal attribute values.private booleaninthashCode()Computes a hash code from attributes:numCrossovers.intstatic MultiPointCrossoverof(int numCrossovers) Construct a new immutableMultiPointCrossoverinstance.toString()Prints the immutable valueMultiPointCrossoverwith attribute values.withNumCrossovers(int value) Copy the current immutable object by setting a value for thenumCrossoversattribute.
-
Field Details
-
numCrossovers
private final int numCrossovers
-
-
Constructor Details
-
ImmutableMultiPointCrossover
private ImmutableMultiPointCrossover(int numCrossovers)
-
-
Method Details
-
numCrossovers
public int numCrossovers()- Specified by:
numCrossoversin classMultiPointCrossover- Returns:
- The value of the
numCrossoversattribute
-
withNumCrossovers
Copy the current immutable object by setting a value for thenumCrossoversattribute. A value equality check is used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for numCrossovers- Returns:
- A modified copy or the
thisobject
-
equals
-
equalsByValue
-
hashCode
-
toString
-
of
Construct a new immutableMultiPointCrossoverinstance.- Parameters:
numCrossovers- The value for thenumCrossoversattribute- Returns:
- An immutable MultiPointCrossover instance
-
copyOf
Creates an immutable copy of aMultiPointCrossovervalue. 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 MultiPointCrossover instance
-
builder
Creates a builder forMultiPointCrossover.ImmutableMultiPointCrossover.builder() .numCrossovers(int) // required
numCrossovers.build();- Returns:
- A new MultiPointCrossover builder
-