Class ImmutableInputOperation<T>

java.lang.Object
net.bmahe.genetics4j.gp.Operation<T>
net.bmahe.genetics4j.gp.math.InputOperation<T>
net.bmahe.genetics4j.gp.math.ImmutableInputOperation<T>

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

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

  • Field Details

    • name

      private final String name
    • returnedType

      private final Class returnedType
    • prettyName

      private final String prettyName
    • index

      private final int index
  • Constructor Details

    • ImmutableInputOperation

      private ImmutableInputOperation(String name, Class returnedType, int index)
    • ImmutableInputOperation

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

      private ImmutableInputOperation(String name, Class returnedType, String prettyName, int index)
  • 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
    • index

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

      public final ImmutableInputOperation<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 ImmutableInputOperation<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 ImmutableInputOperation<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
    • withIndex

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

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

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

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

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

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

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