Class ImmutableCoefficientOperation<T>

java.lang.Object
net.bmahe.genetics4j.gp.Operation<T>
net.bmahe.genetics4j.gp.math.CoefficientOperation<T>
net.bmahe.genetics4j.gp.math.ImmutableCoefficientOperation<T>

@Generated("org.immutables.processor.ProxyProcessor") public final class ImmutableCoefficientOperation<T> extends CoefficientOperation<T>
Immutable implementation of CoefficientOperation.

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

  • Field Details

    • name

      private final String name
    • returnedType

      private final Class returnedType
    • prettyName

      private final String prettyName
    • value

      private final T value
  • Constructor Details

    • ImmutableCoefficientOperation

      private ImmutableCoefficientOperation(String name, Class returnedType, T value)
    • ImmutableCoefficientOperation

      private ImmutableCoefficientOperation(ImmutableCoefficientOperation.Builder<T> builder)
    • ImmutableCoefficientOperation

      private ImmutableCoefficientOperation(String name, Class returnedType, String prettyName, T value)
  • Method Details

    • getName

      public String getName()
      Specified by:
      getName in class Operation<T>
      Returns:
      The value of the name attribute
    • returnedType

      public Class returnedType()
      Specified by:
      returnedType in class Operation<T>
      Returns:
      The value of the returnedType attribute
    • getPrettyName

      public String getPrettyName()
      Overrides:
      getPrettyName in class Operation<T>
      Returns:
      The value of the prettyName attribute
    • value

      public T value()
      Specified by:
      value in class CoefficientOperation<T>
      Returns:
      The value of the value attribute
    • withName

      public final ImmutableCoefficientOperation<T> withName(String value)
      Copy the current immutable object by setting a value for the name attribute. An equals check used to prevent copying of the same value by returning this.
      Parameters:
      value - A new value for name
      Returns:
      A modified copy of the this object
    • withReturnedType

      public final ImmutableCoefficientOperation<T> withReturnedType(Class value)
      Copy the current immutable object by setting a value for the returnedType attribute. A shallow reference equality check is used to prevent copying of the same value by returning this.
      Parameters:
      value - A new value for returnedType
      Returns:
      A modified copy of the this object
    • withPrettyName

      public final ImmutableCoefficientOperation<T> withPrettyName(String value)
      Copy the current immutable object by setting a value for the prettyName attribute. An equals check used to prevent copying of the same value by returning this.
      Parameters:
      value - A new value for prettyName
      Returns:
      A modified copy of the this object
    • withValue

      public final ImmutableCoefficientOperation<T> withValue(T value)
      Copy the current immutable object by setting a value for the value attribute. A shallow reference equality check is used to prevent copying of the same value by returning this.
      Parameters:
      value - A new value for value
      Returns:
      A modified copy of the this object
    • equals

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

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

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

      public static <T> ImmutableCoefficientOperation<T> of(String name, Class returnedType, T value)
      Construct a new immutable CoefficientOperation instance.
      Type Parameters:
      T - generic parameter T
      Parameters:
      name - The value for the name attribute
      returnedType - The value for the returnedType attribute
      value - The value for the value attribute
      Returns:
      An immutable CoefficientOperation instance
    • copyOf

      public static <T> ImmutableCoefficientOperation<T> copyOf(CoefficientOperation<T> instance)
      Creates an immutable copy of a CoefficientOperation value. Uses accessors to get values to initialize the new immutable instance. If an instance is already immutable, it is returned as is.
      Type Parameters:
      T - generic parameter T
      Parameters:
      instance - The instance to copy
      Returns:
      A copied immutable CoefficientOperation instance
    • builder

      public static <T> ImmutableCoefficientOperation.Builder<T> builder()
      Creates a builder for ImmutableCoefficientOperation.
       ImmutableCoefficientOperation.&lt;T&gt;builder()
          .name(String) // required name
          .returnedType(Class) // required returnedType
          .prettyName(String) // optional prettyName
          .value(T) // required value
          .build();
       
      Type Parameters:
      T - generic parameter T
      Returns:
      A new ImmutableCoefficientOperation builder