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(from="CoefficientOperation",
generator="Immutables")
@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
Nested ClassesModifier and TypeClassDescriptionstatic final classBuilds instances of typeCoefficientOperation. -
Field Summary
Fields -
Constructor Summary
ConstructorsModifierConstructorDescriptionprivateImmutableCoefficientOperation(String name, Class returnedType, String prettyName, T value) privateImmutableCoefficientOperation(String name, Class returnedType, T value) private -
Method Summary
Modifier and TypeMethodDescriptionstatic <T> ImmutableCoefficientOperation.Builder<T> builder()Creates a builder forCoefficientOperation.static <T> CoefficientOperation<T> copyOf(CoefficientOperation<T> instance) Creates an immutable copy of aCoefficientOperationvalue.booleanThis instance is equal to all instances ofImmutableCoefficientOperationthat have equal attribute values.private booleanequalsByValue(ImmutableCoefficientOperation<?> another) getName()Returns the name of this operation.Returns a human-readable name for this operation.inthashCode()Computes a hash code from attributes:name,returnedType,prettyName,value.static <T> CoefficientOperation<T> Construct a new immutableCoefficientOperationinstance.Returns the type that this operation returns.toString()Prints the immutable valueCoefficientOperationwith attribute values.value()final ImmutableCoefficientOperation<T> Copy the current immutable object by setting a value for thenameattribute.final ImmutableCoefficientOperation<T> withPrettyName(String value) Copy the current immutable object by setting a value for theprettyNameattribute.final ImmutableCoefficientOperation<T> withReturnedType(Class value) Copy the current immutable object by setting a value for thereturnedTypeattribute.final ImmutableCoefficientOperation<T> Copy the current immutable object by setting a value for thevalueattribute.Methods inherited from class net.bmahe.genetics4j.gp.math.CoefficientOperation
acceptedTypes, computeMethods 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
Returns the name of this operation. -
returnedType
Returns the type that this operation returns.- Specified by:
returnedTypein classOperation<T>- Returns:
- the return type of this operation
-
getPrettyName
Returns a human-readable name for this operation.By default, this returns the same value as
getName(), but can be overridden to provide more descriptive names for display purposes.- Overrides:
getPrettyNamein classOperation<T>- Returns:
- the pretty name for display purposes
-
value
- Specified by:
valuein classCoefficientOperation<T>- Returns:
- The value of the
valueattribute
-
withName
Copy the current immutable object by setting a value for thenameattribute. An equals check used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for name- Returns:
- A modified copy or the
thisobject
-
withReturnedType
Copy the current immutable object by setting a value for thereturnedTypeattribute. 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 or the
thisobject
-
withPrettyName
Copy the current immutable object by setting a value for theprettyNameattribute. An equals check used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for prettyName- Returns:
- A modified copy or the
thisobject
-
withValue
Copy the current immutable object by setting a value for thevalueattribute. 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 or the
thisobject
-
equals
This instance is equal to all instances ofImmutableCoefficientOperationthat have equal attribute values. -
equalsByValue
-
hashCode
public int hashCode()Computes a hash code from attributes:name,returnedType,prettyName,value. -
toString
Prints the immutable valueCoefficientOperationwith attribute values. -
of
Construct a new immutableCoefficientOperationinstance.- Type Parameters:
T- generic parameter T- Parameters:
name- The value for thenameattributereturnedType- The value for thereturnedTypeattributevalue- The value for thevalueattribute- Returns:
- An immutable CoefficientOperation instance
-
copyOf
Creates an immutable copy of aCoefficientOperationvalue. 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 forCoefficientOperation.ImmutableCoefficientOperation.<T>builder() .name(String) // requiredname.returnedType(Class) // requiredreturnedType.prettyName(String) // optionalprettyName.value(T) // requiredvalue.build();- Type Parameters:
T- generic parameter T- Returns:
- A new CoefficientOperation builder
-