Package net.bmahe.genetics4j.gp.math
Class ImmutableInputOperation.Builder<T>
java.lang.Object
net.bmahe.genetics4j.gp.math.ImmutableInputOperation.Builder<T>
- Enclosing class:
ImmutableInputOperation<T>
Builds instances of type
ImmutableInputOperation
.
Initialize attributes and then invoke the build()
method to create an
immutable instance.
Builder
is not thread-safe and generally should not be stored in a field or collection,
but instead used immediately to create instances.
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionbuild()
Builds a newImmutableInputOperation
.private String
private void
final ImmutableInputOperation.Builder
<T> from
(InputOperation<T> instance) Fill a builder with attribute values from the providednet.bmahe.genetics4j.gp.math.InputOperation
instance.final ImmutableInputOperation.Builder
<T> Fill a builder with attribute values from the providednet.bmahe.genetics4j.gp.Operation
instance.final ImmutableInputOperation.Builder
<T> index
(int index) Initializes the value for theindex
attribute.final ImmutableInputOperation.Builder
<T> Initializes the value for thename
attribute.final ImmutableInputOperation.Builder
<T> prettyName
(String prettyName) Initializes the value for theprettyName
attribute.final ImmutableInputOperation.Builder
<T> returnedType
(Class returnedType) Initializes the value for thereturnedType
attribute.
-
Field Details
-
INIT_BIT_NAME
private static final long INIT_BIT_NAME- See Also:
-
INIT_BIT_RETURNED_TYPE
private static final long INIT_BIT_RETURNED_TYPE- See Also:
-
INIT_BIT_INDEX
private static final long INIT_BIT_INDEX- See Also:
-
initBits
private long initBits -
name
-
returnedType
-
prettyName
-
index
private int index
-
-
Constructor Details
-
Builder
private Builder()
-
-
Method Details
-
from
Fill a builder with attribute values from the providednet.bmahe.genetics4j.gp.Operation
instance.- Parameters:
instance
- The instance from which to copy values- Returns:
this
builder for use in a chained invocation
-
from
Fill a builder with attribute values from the providednet.bmahe.genetics4j.gp.math.InputOperation
instance.- Parameters:
instance
- The instance from which to copy values- Returns:
this
builder for use in a chained invocation
-
from
-
name
Initializes the value for thename
attribute.- Parameters:
name
- The value for name- Returns:
this
builder for use in a chained invocation
-
returnedType
Initializes the value for thereturnedType
attribute.- Parameters:
returnedType
- The value for returnedType- Returns:
this
builder for use in a chained invocation
-
prettyName
Initializes the value for theprettyName
attribute.If not set, this attribute will have a default value as returned by the initializer of
prettyName
.- Parameters:
prettyName
- The value for prettyName- Returns:
this
builder for use in a chained invocation
-
index
Initializes the value for theindex
attribute.- Parameters:
index
- The value for index- Returns:
this
builder for use in a chained invocation
-
build
Builds a newImmutableInputOperation
.- Returns:
- An immutable instance of InputOperation
- Throws:
IllegalStateException
- if any required attributes are missing
-
formatRequiredAttributesMessage
-