Class ImmutableMultiPointCrossover
java.lang.Object
net.bmahe.genetics4j.core.spec.combination.MultiPointCrossover
net.bmahe.genetics4j.core.spec.combination.ImmutableMultiPointCrossover
- All Implemented Interfaces:
CombinationPolicy
@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
Modifier and TypeClassDescriptionstatic final class
Builds instances of typeImmutableMultiPointCrossover
. -
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionbuilder()
Creates a builder forImmutableMultiPointCrossover
.static ImmutableMultiPointCrossover
copyOf
(MultiPointCrossover instance) Creates an immutable copy of aMultiPointCrossover
value.boolean
This instance is equal to all instances ofImmutableMultiPointCrossover
that have equal attribute values.private boolean
equalTo
(int synthetic, ImmutableMultiPointCrossover another) int
hashCode()
Computes a hash code from attributes:numCrossovers
.int
static ImmutableMultiPointCrossover
of
(int numCrossovers) Construct a new immutableMultiPointCrossover
instance.toString()
Prints the immutable valueMultiPointCrossover
with attribute values.withNumCrossovers
(int value) Copy the current immutable object by setting a value for thenumCrossovers
attribute.
-
Field Details
-
numCrossovers
private final int numCrossovers
-
-
Constructor Details
-
ImmutableMultiPointCrossover
private ImmutableMultiPointCrossover(int numCrossovers)
-
-
Method Details
-
numCrossovers
public int numCrossovers()- Specified by:
numCrossovers
in classMultiPointCrossover
- Returns:
- The value of the
numCrossovers
attribute
-
withNumCrossovers
Copy the current immutable object by setting a value for thenumCrossovers
attribute. 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 of the
this
object
-
equals
This instance is equal to all instances ofImmutableMultiPointCrossover
that have equal attribute values. -
equalTo
-
hashCode
public int hashCode()Computes a hash code from attributes:numCrossovers
. -
toString
Prints the immutable valueMultiPointCrossover
with attribute values. -
of
Construct a new immutableMultiPointCrossover
instance.- Parameters:
numCrossovers
- The value for thenumCrossovers
attribute- Returns:
- An immutable MultiPointCrossover instance
-
copyOf
Creates an immutable copy of aMultiPointCrossover
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 MultiPointCrossover instance
-
builder
Creates a builder forImmutableMultiPointCrossover
.ImmutableMultiPointCrossover.builder() .numCrossovers(int) // required
numCrossovers
.build();- Returns:
- A new ImmutableMultiPointCrossover builder
-