Class ImmutableRule.Builder

java.lang.Object
net.bmahe.genetics4j.gp.spec.mutation.ImmutableRule.Builder
Enclosing class:
ImmutableRule

@Generated(from="Rule", generator="Immutables") public static final class ImmutableRule.Builder extends Object
Builds instances of type Rule. 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 Details

  • Constructor Details

    • Builder

      private Builder()
  • Method Details

    • from

      public final ImmutableRule.Builder from(Rule instance)
      Fill a builder with attribute values from the provided Rule instance. Regular attribute values will be replaced with those from the given instance. Absent optional values will not replace present values.
      Parameters:
      instance - The instance from which to copy values
      Returns:
      this builder for use in a chained invocation
    • predicate

      public final ImmutableRule.Builder predicate(Predicate<TreeNode<Operation<?>>> predicate)
      Initializes the value for the predicate attribute.
      Parameters:
      predicate - The value for predicate
      Returns:
      this builder for use in a chained invocation
    • applicator

      public final ImmutableRule.Builder applicator(BiFunction<Program,TreeNode<Operation<?>>,TreeNode<Operation<?>>> applicator)
      Initializes the value for the applicator attribute.
      Parameters:
      applicator - The value for applicator
      Returns:
      this builder for use in a chained invocation
    • build

      public Rule build()
      Builds a new Rule.
      Returns:
      An immutable instance of Rule
      Throws:
      IllegalStateException - if any required attributes are missing
    • formatRequiredAttributesMessage

      private String formatRequiredAttributesMessage()