Class ImmutableMultiTournaments.Builder<T extends Comparable<T>>
java.lang.Object
net.bmahe.genetics4j.core.spec.selection.ImmutableMultiTournaments.Builder<T>
- Enclosing class:
ImmutableMultiTournaments<T extends Comparable<T>>
@Generated(from="MultiTournaments",
generator="Immutables")
public static final class ImmutableMultiTournaments.Builder<T extends Comparable<T>>
extends Object
Builds instances of type
MultiTournaments.
Initialize attributes and then invoke the build() method to create an
immutable instance.
Builder is not thread-safe and generally should not be stored in a field or collection,
but instead used immediately to create instances.
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionaddAllTournaments(Iterable<? extends Tournament<T>> elements) Adds elements totournamentslist.addTournaments(Tournament<T> element) Adds one element totournamentslist.addTournaments(Tournament<T>... elements) Adds elements totournamentslist.build()Builds a newMultiTournaments.from(MultiTournaments<T> instance) Fill a builder with attribute values from the providedMultiTournamentsinstance.tournaments(Iterable<? extends Tournament<T>> elements) Sets or replaces all elements fortournamentslist.
-
Field Details
-
tournaments
-
-
Constructor Details
-
Builder
private Builder()
-
-
Method Details
-
from
Fill a builder with attribute values from the providedMultiTournamentsinstance. Regular attribute values will be replaced with those from the given instance. Absent optional values will not replace present values. Collection elements and entries will be added, not replaced.- Parameters:
instance- The instance from which to copy values- Returns:
thisbuilder for use in a chained invocation
-
addTournaments
Adds one element totournamentslist.- Parameters:
element- A tournaments element- Returns:
thisbuilder for use in a chained invocation
-
addTournaments
@SafeVarargs public final ImmutableMultiTournaments.Builder<T> addTournaments(Tournament<T>... elements) Adds elements totournamentslist.- Parameters:
elements- An array of tournaments elements- Returns:
thisbuilder for use in a chained invocation
-
tournaments
public final ImmutableMultiTournaments.Builder<T> tournaments(Iterable<? extends Tournament<T>> elements) Sets or replaces all elements fortournamentslist.- Parameters:
elements- An iterable of tournaments elements- Returns:
thisbuilder for use in a chained invocation
-
addAllTournaments
public final ImmutableMultiTournaments.Builder<T> addAllTournaments(Iterable<? extends Tournament<T>> elements) Adds elements totournamentslist.- Parameters:
elements- An iterable of tournaments elements- Returns:
thisbuilder for use in a chained invocation
-
build
Builds a newMultiTournaments.- Returns:
- An immutable instance of MultiTournaments
- Throws:
IllegalStateException- if any required attributes are missing
-