Class ImmutableGenerationalReplacement
java.lang.Object
net.bmahe.genetics4j.core.spec.replacement.ImmutableGenerationalReplacement
- All Implemented Interfaces:
GenerationalReplacement,ReplacementStrategy
@Generated(from="GenerationalReplacement",
generator="Immutables")
@Generated("org.immutables.processor.ProxyProcessor")
public final class ImmutableGenerationalReplacement
extends Object
implements GenerationalReplacement
Immutable implementation of
GenerationalReplacement.
Use the builder to create immutable instances:
new GenerationalReplacement.Builder().
-
Nested Class Summary
Nested Classes -
Field Summary
Fields -
Constructor Summary
ConstructorsModifierConstructorDescriptionprivateImmutableGenerationalReplacement(SelectionPolicy offspringSelectionPolicy) -
Method Summary
Modifier and TypeMethodDescriptionstatic GenerationalReplacementcopyOf(GenerationalReplacement instance) Creates an immutable copy of aGenerationalReplacementvalue.booleanThis instance is equal to all instances ofImmutableGenerationalReplacementthat have equal attribute values.private booleaninthashCode()Computes a hash code from attributes:offspringSelectionPolicy.toString()Prints the immutable valueGenerationalReplacementwith attribute values.Copy the current immutable object by setting a value for theoffspringSelectionPolicyattribute.
-
Field Details
-
offspringSelectionPolicy
-
-
Constructor Details
-
ImmutableGenerationalReplacement
-
-
Method Details
-
offspringSelectionPolicy
- Specified by:
offspringSelectionPolicyin interfaceGenerationalReplacement- Returns:
- The value of the
offspringSelectionPolicyattribute
-
withOffspringSelectionPolicy
Copy the current immutable object by setting a value for theoffspringSelectionPolicyattribute. A shallow reference equality check is used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for offspringSelectionPolicy- Returns:
- A modified copy or the
thisobject
-
equals
This instance is equal to all instances ofImmutableGenerationalReplacementthat have equal attribute values. -
equalsByValue
-
hashCode
public int hashCode()Computes a hash code from attributes:offspringSelectionPolicy. -
toString
Prints the immutable valueGenerationalReplacementwith attribute values. -
copyOf
Creates an immutable copy of aGenerationalReplacementvalue. 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 GenerationalReplacement instance
-