Package net.bmahe.genetics4j.gp.math
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()
.
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic final class
Builds instances of typeImmutableInputOperation
. -
Field Summary
-
Constructor Summary
ModifierConstructorDescriptionprivate
ImmutableInputOperation
(String name, Class returnedType, int index) private
ImmutableInputOperation
(String name, Class returnedType, String prettyName, int index) private
-
Method Summary
Modifier and TypeMethodDescriptionstatic <T> ImmutableInputOperation.Builder
<T> builder()
Creates a builder forImmutableInputOperation
.static <T> ImmutableInputOperation
<T> copyOf
(InputOperation<T> instance) Creates an immutable copy of aInputOperation
value.boolean
This instance is equal to all instances ofImmutableInputOperation
that have equal attribute values.private boolean
equalTo
(int synthetic, ImmutableInputOperation<?> another) getName()
int
hashCode()
Computes a hash code from attributes:name
,returnedType
,prettyName
,index
.int
index()
static <T> ImmutableInputOperation
<T> Construct a new immutableInputOperation
instance.toString()
Prints the immutable valueInputOperation
with attribute values.final ImmutableInputOperation
<T> withIndex
(int value) Copy the current immutable object by setting a value for theindex
attribute.final ImmutableInputOperation
<T> Copy the current immutable object by setting a value for thename
attribute.final ImmutableInputOperation
<T> withPrettyName
(String value) Copy the current immutable object by setting a value for theprettyName
attribute.final ImmutableInputOperation
<T> withReturnedType
(Class value) Copy the current immutable object by setting a value for thereturnedType
attribute.Methods inherited from class net.bmahe.genetics4j.gp.math.InputOperation
acceptedTypes, compute
Methods inherited from class net.bmahe.genetics4j.gp.Operation
apply, getArity, isTerminal
-
Field Details
-
name
-
returnedType
-
prettyName
-
index
private final int index
-
-
Constructor Details
-
ImmutableInputOperation
-
ImmutableInputOperation
-
ImmutableInputOperation
-
-
Method Details
-
getName
-
returnedType
- Specified by:
returnedType
in classOperation<T>
- Returns:
- The value of the
returnedType
attribute
-
getPrettyName
- Overrides:
getPrettyName
in classOperation<T>
- Returns:
- The value of the
prettyName
attribute
-
index
public int index()- Specified by:
index
in classInputOperation<T>
- Returns:
- The value of the
index
attribute
-
withName
Copy the current immutable object by setting a value for thename
attribute. An equals check used to prevent copying of the same value by returningthis
.- Parameters:
value
- A new value for name- Returns:
- A modified copy of the
this
object
-
withReturnedType
Copy the current immutable object by setting a value for thereturnedType
attribute. A shallow reference equality check is used to prevent copying of the same value by returningthis
.- Parameters:
value
- A new value for returnedType- Returns:
- A modified copy of the
this
object
-
withPrettyName
Copy the current immutable object by setting a value for theprettyName
attribute. An equals check used to prevent copying of the same value by returningthis
.- Parameters:
value
- A new value for prettyName- Returns:
- A modified copy of the
this
object
-
withIndex
Copy the current immutable object by setting a value for theindex
attribute. A value equality check is used to prevent copying of the same value by returningthis
.- Parameters:
value
- A new value for index- Returns:
- A modified copy of the
this
object
-
equals
This instance is equal to all instances ofImmutableInputOperation
that have equal attribute values. -
equalTo
-
hashCode
public int hashCode()Computes a hash code from attributes:name
,returnedType
,prettyName
,index
. -
toString
Prints the immutable valueInputOperation
with attribute values. -
of
Construct a new immutableInputOperation
instance.- Type Parameters:
T
- generic parameter T- Parameters:
name
- The value for thename
attributereturnedType
- The value for thereturnedType
attributeindex
- The value for theindex
attribute- Returns:
- An immutable InputOperation instance
-
copyOf
Creates an immutable copy of aInputOperation
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
Creates a builder forImmutableInputOperation
.ImmutableInputOperation.<T>builder() .name(String) // required
name
.returnedType(Class) // requiredreturnedType
.prettyName(String) // optionalprettyName
.index(int) // requiredindex
.build();- Type Parameters:
T
- generic parameter T- Returns:
- A new ImmutableInputOperation builder
-