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

  • Field Details

  • Constructor Details

  • Method Details

    • selectionPolicies

      public List<SelectionPolicy> selectionPolicies()
      Specified by:
      selectionPolicies in class MultiSelections
      Returns:
      The value of the selectionPolicies attribute
    • withSelectionPolicies

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

      public boolean equals(Object another)
      This instance is equal to all instances of ImmutableMultiSelections 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, ImmutableMultiSelections another)
    • hashCode

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

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

      public static ImmutableMultiSelections of(List<SelectionPolicy> selectionPolicies)
      Construct a new immutable MultiSelections instance.
      Parameters:
      selectionPolicies - The value for the selectionPolicies attribute
      Returns:
      An immutable MultiSelections instance
    • of

      public static ImmutableMultiSelections of(Iterable<? extends SelectionPolicy> selectionPolicies)
      Construct a new immutable MultiSelections instance.
      Parameters:
      selectionPolicies - The value for the selectionPolicies attribute
      Returns:
      An immutable MultiSelections instance
    • validate

      private static ImmutableMultiSelections validate(ImmutableMultiSelections instance)
    • copyOf

      public static ImmutableMultiSelections copyOf(MultiSelections instance)
      Creates an immutable copy of a MultiSelections 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

      public static ImmutableMultiSelections.Builder builder()
      Creates a builder for ImmutableMultiSelections.
       ImmutableMultiSelections.builder()
          .addSelectionPolicies|addAllSelectionPolicies(net.bmahe.genetics4j.core.spec.selection.SelectionPolicy) // selectionPolicies elements
          .build();
       
      Returns:
      A new ImmutableMultiSelections 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)