Class ImmutableMultiTournaments<T extends Comparable<T>>
java.lang.Object
net.bmahe.genetics4j.core.spec.selection.ImmutableMultiTournaments<T>
- All Implemented Interfaces:
MultiTournaments<T>
,SelectionPolicy
@Generated("org.immutables.processor.ProxyProcessor")
public final class ImmutableMultiTournaments<T extends Comparable<T>>
extends Object
implements MultiTournaments<T>
Immutable implementation of
MultiTournaments
.
Use the builder to create immutable instances:
ImmutableMultiTournaments.builder()
.
Use the static factory method to create immutable instances:
ImmutableMultiTournaments.of()
.
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic final class
ImmutableMultiTournaments.Builder<T extends Comparable<T>>
Builds instances of typeMultiTournaments
. -
Field Summary
-
Constructor Summary
ModifierConstructorDescriptionprivate
ImmutableMultiTournaments
(Iterable<? extends Tournament<T>> tournaments) private
ImmutableMultiTournaments
(ImmutableMultiTournaments<T> original, List<Tournament<T>> tournaments) -
Method Summary
Modifier and TypeMethodDescriptionstatic <T extends Comparable<T>>
ImmutableMultiTournaments.Builder<T> builder()
Creates a builder forMultiTournaments
.static <T extends Comparable<T>>
MultiTournaments<T> copyOf
(MultiTournaments<T> instance) Creates an immutable copy of aMultiTournaments
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 ofImmutableMultiTournaments
that have equal attribute values.private boolean
equalTo
(int synthetic, ImmutableMultiTournaments<?> another) int
hashCode()
Computes a hash code from attributes:tournaments
.static <T extends Comparable<T>>
MultiTournaments<T> of
(Iterable<? extends Tournament<T>> tournaments) Construct a new immutableMultiTournaments
instance.static <T extends Comparable<T>>
MultiTournaments<T> of
(List<Tournament<T>> tournaments) Construct a new immutableMultiTournaments
instance.toString()
Prints the immutable valueMultiTournaments
with attribute values.List
<Tournament<T>> final ImmutableMultiTournaments
<T> withTournaments
(Iterable<? extends Tournament<T>> elements) Copy the current immutable object with elements that replace the content oftournaments
.final ImmutableMultiTournaments
<T> withTournaments
(Tournament<T>... elements) Copy the current immutable object with elements that replace the content oftournaments
.
-
Field Details
-
tournaments
-
-
Constructor Details
-
ImmutableMultiTournaments
-
ImmutableMultiTournaments
private ImmutableMultiTournaments(ImmutableMultiTournaments<T> original, List<Tournament<T>> tournaments)
-
-
Method Details
-
tournaments
- Specified by:
tournaments
in interfaceMultiTournaments<T extends Comparable<T>>
- Returns:
- The value of the
tournaments
attribute
-
withTournaments
Copy the current immutable object with elements that replace the content oftournaments
.- Parameters:
elements
- The elements to set- Returns:
- A modified copy of
this
object
-
withTournaments
public final ImmutableMultiTournaments<T> withTournaments(Iterable<? extends Tournament<T>> elements) Copy the current immutable object with elements that replace the content oftournaments
. A shallow reference equality check is used to prevent copying of the same value by returningthis
.- Parameters:
elements
- An iterable of tournaments elements to set- Returns:
- A modified copy of
this
object
-
equals
This instance is equal to all instances ofImmutableMultiTournaments
that have equal attribute values. -
equalTo
-
hashCode
public int hashCode()Computes a hash code from attributes:tournaments
. -
toString
Prints the immutable valueMultiTournaments
with attribute values. -
of
Construct a new immutableMultiTournaments
instance.- Type Parameters:
T
- generic parameter T- Parameters:
tournaments
- The value for thetournaments
attribute- Returns:
- An immutable MultiTournaments instance
-
of
public static <T extends Comparable<T>> MultiTournaments<T> of(Iterable<? extends Tournament<T>> tournaments) Construct a new immutableMultiTournaments
instance.- Type Parameters:
T
- generic parameter T- Parameters:
tournaments
- The value for thetournaments
attribute- Returns:
- An immutable MultiTournaments instance
-
copyOf
Creates an immutable copy of aMultiTournaments
value. Uses accessors to get values to initialize the new immutable instance. If an instance is already immutable, it is returned as is.- Type Parameters:
T
- generic parameter T- Parameters:
instance
- The instance to copy- Returns:
- A copied immutable MultiTournaments instance
-
builder
Creates a builder forMultiTournaments
.ImmutableMultiTournaments.<T>builder() .addTournaments|addAllTournaments(net.bmahe.genetics4j.core.spec.selection.Tournament<T>) //
tournaments
elements .build();- Type Parameters:
T
- generic parameter T- Returns:
- A new MultiTournaments builder
-
createSafeList
-
createUnmodifiableList
-