Class ImmutableProgramApplyRules

java.lang.Object
net.bmahe.genetics4j.gp.spec.mutation.ImmutableProgramApplyRules
All Implemented Interfaces:
MutationPolicy, ProgramApplyRules

@Generated("org.immutables.processor.ProxyProcessor") public final class ImmutableProgramApplyRules extends Object implements ProgramApplyRules
Immutable implementation of ProgramApplyRules.

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

  • Field Details

    • rules

      private final List<Rule> rules
  • Constructor Details

  • Method Details

    • rules

      public List<Rule> rules()
      Specified by:
      rules in interface ProgramApplyRules
      Returns:
      The value of the rules attribute
    • withRules

      public final ImmutableProgramApplyRules withRules(Rule... elements)
      Copy the current immutable object with elements that replace the content of rules.
      Parameters:
      elements - The elements to set
      Returns:
      A modified copy of this object
    • withRules

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

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

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

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

      public static ImmutableProgramApplyRules of(List<Rule> rules)
      Construct a new immutable ProgramApplyRules instance.
      Parameters:
      rules - The value for the rules attribute
      Returns:
      An immutable ProgramApplyRules instance
    • of

      public static ImmutableProgramApplyRules of(Iterable<? extends Rule> rules)
      Construct a new immutable ProgramApplyRules instance.
      Parameters:
      rules - The value for the rules attribute
      Returns:
      An immutable ProgramApplyRules instance
    • copyOf

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

      public static ImmutableProgramApplyRules.Builder builder()
      Creates a builder for ImmutableProgramApplyRules.
       ImmutableProgramApplyRules.builder()
          .addRules|addAllRules(net.bmahe.genetics4j.gp.spec.mutation.Rule) // rules elements
          .build();
       
      Returns:
      A new ImmutableProgramApplyRules 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)