Class ImmutableMultiSelections
java.lang.Object
net.bmahe.genetics4j.core.spec.selection.MultiSelections
net.bmahe.genetics4j.core.spec.selection.ImmutableMultiSelections
- All Implemented Interfaces:
SelectionPolicy
@Generated(from="MultiSelections",
generator="Immutables")
@Generated("org.immutables.processor.ProxyProcessor")
public final class ImmutableMultiSelections
extends MultiSelections
Immutable implementation of
MultiSelections.
Use the builder to create immutable instances:
ImmutableMultiSelections.builder().
Use the static factory method to create immutable instances:
ImmutableMultiSelections.of().
-
Nested Class Summary
Nested Classes -
Field Summary
Fields -
Constructor Summary
ConstructorsModifierConstructorDescriptionprivateImmutableMultiSelections(Iterable<? extends SelectionPolicy> selectionPolicies) privateImmutableMultiSelections(ImmutableMultiSelections original, List<SelectionPolicy> selectionPolicies) -
Method Summary
Modifier and TypeMethodDescriptionbuilder()Creates a builder forMultiSelections.static MultiSelectionscopyOf(MultiSelections instance) Creates an immutable copy of aMultiSelectionsvalue.private static <T> List<T> createSafeList(Iterable<? extends T> iterable, boolean checkNulls, boolean skipNulls) private static <T> List<T> createUnmodifiableList(boolean clone, List<? extends T> list) booleanThis instance is equal to all instances ofImmutableMultiSelectionsthat have equal attribute values.private booleanequalsByValue(ImmutableMultiSelections another) inthashCode()Computes a hash code from attributes:selectionPolicies.static MultiSelectionsof(Iterable<? extends SelectionPolicy> selectionPolicies) Construct a new immutableMultiSelectionsinstance.static MultiSelectionsof(List<SelectionPolicy> selectionPolicies) Construct a new immutableMultiSelectionsinstance.toString()Prints the immutable valueMultiSelectionswith attribute values.private static ImmutableMultiSelectionsvalidate(ImmutableMultiSelections instance) final ImmutableMultiSelectionswithSelectionPolicies(Iterable<? extends SelectionPolicy> elements) Copy the current immutable object with elements that replace the content ofselectionPolicies.final ImmutableMultiSelectionswithSelectionPolicies(SelectionPolicy... elements) Copy the current immutable object with elements that replace the content ofselectionPolicies.Methods inherited from class net.bmahe.genetics4j.core.spec.selection.MultiSelections
check, of
-
Field Details
-
selectionPolicies
-
-
Constructor Details
-
ImmutableMultiSelections
-
ImmutableMultiSelections
private ImmutableMultiSelections(ImmutableMultiSelections original, List<SelectionPolicy> selectionPolicies)
-
-
Method Details
-
selectionPolicies
- Specified by:
selectionPoliciesin classMultiSelections- Returns:
- The value of the
selectionPoliciesattribute
-
withSelectionPolicies
Copy the current immutable object with elements that replace the content ofselectionPolicies.- Parameters:
elements- The elements to set- Returns:
- A modified copy of
thisobject
-
withSelectionPolicies
public final ImmutableMultiSelections withSelectionPolicies(Iterable<? extends SelectionPolicy> elements) Copy the current immutable object with elements that replace the content ofselectionPolicies. A shallow reference equality check is used to prevent copying of the same value by returningthis.- Parameters:
elements- An iterable of selectionPolicies elements to set- Returns:
- A modified copy or
thisif not changed
-
equals
This instance is equal to all instances ofImmutableMultiSelectionsthat have equal attribute values. -
equalsByValue
-
hashCode
public int hashCode()Computes a hash code from attributes:selectionPolicies. -
toString
Prints the immutable valueMultiSelectionswith attribute values. -
of
Construct a new immutableMultiSelectionsinstance.- Parameters:
selectionPolicies- The value for theselectionPoliciesattribute- Returns:
- An immutable MultiSelections instance
-
of
Construct a new immutableMultiSelectionsinstance.- Parameters:
selectionPolicies- The value for theselectionPoliciesattribute- Returns:
- An immutable MultiSelections instance
-
validate
-
copyOf
Creates an immutable copy of aMultiSelectionsvalue. 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 MultiSelections instance
-
builder
Creates a builder forMultiSelections.ImmutableMultiSelections.builder() .addSelectionPolicies|addAllSelectionPolicies(net.bmahe.genetics4j.core.spec.selection.SelectionPolicy) //selectionPolicieselements .build();- Returns:
- A new MultiSelections builder
-
createSafeList
-
createUnmodifiableList
-