Class ImmutableMultiMutations

java.lang.Object
net.bmahe.genetics4j.core.spec.mutation.MultiMutations
net.bmahe.genetics4j.core.spec.mutation.ImmutableMultiMutations
All Implemented Interfaces:
MutationPolicy

@Generated("org.immutables.processor.ProxyProcessor") public final class ImmutableMultiMutations extends MultiMutations
Immutable implementation of MultiMutations.

Use the builder to create immutable instances: ImmutableMultiMutations.builder(). Use the static factory method to create immutable instances: ImmutableMultiMutations.of().

  • Field Details

  • Constructor Details

  • Method Details

    • mutationPolicies

      public List<MutationPolicy> mutationPolicies()
      Specified by:
      mutationPolicies in class MultiMutations
      Returns:
      The value of the mutationPolicies attribute
    • withMutationPolicies

      public final ImmutableMultiMutations withMutationPolicies(MutationPolicy... elements)
      Copy the current immutable object with elements that replace the content of mutationPolicies.
      Parameters:
      elements - The elements to set
      Returns:
      A modified copy of this object
    • withMutationPolicies

      public final ImmutableMultiMutations withMutationPolicies(Iterable<? extends MutationPolicy> elements)
      Copy the current immutable object with elements that replace the content of mutationPolicies. A shallow reference equality check is used to prevent copying of the same value by returning this.
      Parameters:
      elements - An iterable of mutationPolicies elements to set
      Returns:
      A modified copy of this object
    • equals

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

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

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

      public static ImmutableMultiMutations of(List<MutationPolicy> mutationPolicies)
      Construct a new immutable MultiMutations instance.
      Parameters:
      mutationPolicies - The value for the mutationPolicies attribute
      Returns:
      An immutable MultiMutations instance
    • of

      public static ImmutableMultiMutations of(Iterable<? extends MutationPolicy> mutationPolicies)
      Construct a new immutable MultiMutations instance.
      Parameters:
      mutationPolicies - The value for the mutationPolicies attribute
      Returns:
      An immutable MultiMutations instance
    • validate

      private static ImmutableMultiMutations validate(ImmutableMultiMutations instance)
    • copyOf

      public static ImmutableMultiMutations copyOf(MultiMutations instance)
      Creates an immutable copy of a MultiMutations 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 MultiMutations instance
    • builder

      public static ImmutableMultiMutations.Builder builder()
      Creates a builder for ImmutableMultiMutations.
       ImmutableMultiMutations.builder()
          .addMutationPolicies|addAllMutationPolicies(net.bmahe.genetics4j.core.spec.mutation.MutationPolicy) // mutationPolicies elements
          .build();
       
      Returns:
      A new ImmutableMultiMutations 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)