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().

  • Field Details

  • Constructor Details

  • Method Details

    • tournaments

      public List<Tournament<T>> tournaments()
      Specified by:
      tournaments in interface MultiTournaments<T extends Comparable<T>>
      Returns:
      The value of the tournaments attribute
    • withTournaments

      @SafeVarargs public final ImmutableMultiTournaments<T> withTournaments(Tournament<T>... elements)
      Copy the current immutable object with elements that replace the content of tournaments.
      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 of tournaments. A shallow reference equality check is used to prevent copying of the same value by returning this.
      Parameters:
      elements - An iterable of tournaments elements to set
      Returns:
      A modified copy of this object
    • equals

      public boolean equals(Object another)
      This instance is equal to all instances of ImmutableMultiTournaments that have equal attribute values.
      Overrides:
      equals in class Object
      Returns:
      true if this is equal to another instance
    • equalTo

      private boolean equalTo(int synthetic, ImmutableMultiTournaments<?> another)
    • hashCode

      public int hashCode()
      Computes a hash code from attributes: tournaments.
      Overrides:
      hashCode in class Object
      Returns:
      hashCode value
    • toString

      public String toString()
      Prints the immutable value MultiTournaments with attribute values.
      Overrides:
      toString in class Object
      Returns:
      A string representation of the value
    • of

      public static <T extends Comparable<T>> MultiTournaments<T> of(List<Tournament<T>> tournaments)
      Construct a new immutable MultiTournaments instance.
      Type Parameters:
      T - generic parameter T
      Parameters:
      tournaments - The value for the tournaments attribute
      Returns:
      An immutable MultiTournaments instance
    • of

      public static <T extends Comparable<T>> MultiTournaments<T> of(Iterable<? extends Tournament<T>> tournaments)
      Construct a new immutable MultiTournaments instance.
      Type Parameters:
      T - generic parameter T
      Parameters:
      tournaments - The value for the tournaments attribute
      Returns:
      An immutable MultiTournaments instance
    • copyOf

      public static <T extends Comparable<T>> MultiTournaments<T> copyOf(MultiTournaments<T> instance)
      Creates an immutable copy of a MultiTournaments 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

      public static <T extends Comparable<T>> ImmutableMultiTournaments.Builder<T> builder()
      Creates a builder for MultiTournaments.
       ImmutableMultiTournaments.&lt;T&gt;builder()
          .addTournaments|addAllTournaments(net.bmahe.genetics4j.core.spec.selection.Tournament&lt;T&gt;) // tournaments elements
          .build();
       
      Type Parameters:
      T - generic parameter T
      Returns:
      A new MultiTournaments builder
    • createSafeList

      private static <T> List<T> createSafeList(Iterable<? extends T> iterable, boolean checkNulls, boolean skipNulls)
    • createUnmodifiableList

      private static <T> List<T> createUnmodifiableList(boolean clone, List<T> list)