Class ImmutableCoefficientOperation.Builder<T>

java.lang.Object
net.bmahe.genetics4j.gp.math.ImmutableCoefficientOperation.Builder<T>
Enclosing class:
ImmutableCoefficientOperation<T>

public static final class ImmutableCoefficientOperation.Builder<T> extends Object
Builds instances of type ImmutableCoefficientOperation. 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

    • INIT_BIT_NAME

      private static final long INIT_BIT_NAME
      See Also:
    • INIT_BIT_RETURNED_TYPE

      private static final long INIT_BIT_RETURNED_TYPE
      See Also:
    • INIT_BIT_VALUE

      private static final long INIT_BIT_VALUE
      See Also:
    • initBits

      private long initBits
    • name

      private String name
    • returnedType

      private Class returnedType
    • prettyName

      private String prettyName
    • value

      private T value
  • Constructor Details

    • Builder

      private Builder()
  • Method Details

    • from

      public final ImmutableCoefficientOperation.Builder<T> from(Operation<T> instance)
      Fill a builder with attribute values from the provided net.bmahe.genetics4j.gp.Operation instance.
      Parameters:
      instance - The instance from which to copy values
      Returns:
      this builder for use in a chained invocation
    • from

      Fill a builder with attribute values from the provided net.bmahe.genetics4j.gp.math.CoefficientOperation instance.
      Parameters:
      instance - The instance from which to copy values
      Returns:
      this builder for use in a chained invocation
    • from

      private void from(short _unused, Object object)
    • name

      public final ImmutableCoefficientOperation.Builder<T> name(String name)
      Initializes the value for the name attribute.
      Parameters:
      name - The value for name
      Returns:
      this builder for use in a chained invocation
    • returnedType

      public final ImmutableCoefficientOperation.Builder<T> returnedType(Class returnedType)
      Initializes the value for the returnedType attribute.
      Parameters:
      returnedType - The value for returnedType
      Returns:
      this builder for use in a chained invocation
    • prettyName

      public final ImmutableCoefficientOperation.Builder<T> prettyName(String prettyName)
      Initializes the value for the prettyName attribute.

      If not set, this attribute will have a default value as returned by the initializer of prettyName.

      Parameters:
      prettyName - The value for prettyName
      Returns:
      this builder for use in a chained invocation
    • value

      public final ImmutableCoefficientOperation.Builder<T> value(T value)
      Initializes the value for the value attribute.
      Parameters:
      value - The value for value
      Returns:
      this builder for use in a chained invocation
    • build

      Returns:
      An immutable instance of CoefficientOperation
      Throws:
      IllegalStateException - if any required attributes are missing
    • formatRequiredAttributesMessage

      private String formatRequiredAttributesMessage()