Class ImmutableMultiSelections
java.lang.Object
net.bmahe.genetics4j.core.spec.selection.MultiSelections
net.bmahe.genetics4j.core.spec.selection.ImmutableMultiSelections
- All Implemented Interfaces:
SelectionPolicy
@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
Modifier and TypeClassDescriptionstatic final class
Builds instances of typeImmutableMultiSelections
. -
Field Summary
-
Constructor Summary
ModifierConstructorDescriptionprivate
ImmutableMultiSelections
(Iterable<? extends SelectionPolicy> selectionPolicies) private
ImmutableMultiSelections
(ImmutableMultiSelections original, List<SelectionPolicy> selectionPolicies) -
Method Summary
Modifier and TypeMethodDescriptionbuilder()
Creates a builder forImmutableMultiSelections
.static ImmutableMultiSelections
copyOf
(MultiSelections instance) Creates an immutable copy of aMultiSelections
value.private static <T> List
<T> createSafeList
(Iterable<? extends T> iterable, boolean checkNulls, boolean skipNulls) private static <T> List
<T> createUnmodifiableList
(boolean clone, List<T> list) boolean
This instance is equal to all instances ofImmutableMultiSelections
that have equal attribute values.private boolean
equalTo
(int synthetic, ImmutableMultiSelections another) int
hashCode()
Computes a hash code from attributes:selectionPolicies
.static ImmutableMultiSelections
of
(Iterable<? extends SelectionPolicy> selectionPolicies) Construct a new immutableMultiSelections
instance.static ImmutableMultiSelections
of
(List<SelectionPolicy> selectionPolicies) Construct a new immutableMultiSelections
instance.toString()
Prints the immutable valueMultiSelections
with attribute values.private static ImmutableMultiSelections
validate
(ImmutableMultiSelections instance) final ImmutableMultiSelections
withSelectionPolicies
(Iterable<? extends SelectionPolicy> elements) Copy the current immutable object with elements that replace the content ofselectionPolicies
.final ImmutableMultiSelections
withSelectionPolicies
(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:
selectionPolicies
in classMultiSelections
- Returns:
- The value of the
selectionPolicies
attribute
-
withSelectionPolicies
Copy the current immutable object with elements that replace the content ofselectionPolicies
.- Parameters:
elements
- The elements to set- Returns:
- A modified copy of
this
object
-
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 of
this
object
-
equals
This instance is equal to all instances ofImmutableMultiSelections
that have equal attribute values. -
equalTo
-
hashCode
public int hashCode()Computes a hash code from attributes:selectionPolicies
. -
toString
Prints the immutable valueMultiSelections
with attribute values. -
of
Construct a new immutableMultiSelections
instance.- Parameters:
selectionPolicies
- The value for theselectionPolicies
attribute- Returns:
- An immutable MultiSelections instance
-
of
Construct a new immutableMultiSelections
instance.- Parameters:
selectionPolicies
- The value for theselectionPolicies
attribute- Returns:
- An immutable MultiSelections instance
-
validate
-
copyOf
Creates an immutable copy of aMultiSelections
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 MultiSelections instance
-
builder
Creates a builder forImmutableMultiSelections
.ImmutableMultiSelections.builder() .addSelectionPolicies|addAllSelectionPolicies(net.bmahe.genetics4j.core.spec.selection.SelectionPolicy) //
selectionPolicies
elements .build();- Returns:
- A new ImmutableMultiSelections builder
-
createSafeList
-
createUnmodifiableList
-