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