Package io.github.ai4ci.util
Class ImmutableEmpiricalFunction.Builder
java.lang.Object
io.github.ai4ci.util.ImmutableEmpiricalFunction.Builder
- Enclosing class:
- ImmutableEmpiricalFunction
Builds instances of type
ImmutableEmpiricalFunction
.
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.
-
Method Summary
Modifier and TypeMethodDescriptionbuild()
Builds a newImmutableEmpiricalFunction
.from
(EmpiricalFunction instance) Fill a builder with attribute values from the providedEmpiricalFunction
instance.Initializes the value for thelink
attribute.setX
(double... x) Initializes the value for thex
attribute.setY
(double... y) Initializes the value for they
attribute.
-
Method Details
-
from
@CanIgnoreReturnValue public final ImmutableEmpiricalFunction.Builder from(EmpiricalFunction instance) Fill a builder with attribute values from the providedEmpiricalFunction
instance. Regular attribute values will be replaced with those from the given instance. Absent optional values will not replace present values.- Parameters:
instance
- The instance from which to copy values- Returns:
this
builder for use in a chained invocation
-
setX
Initializes the value for thex
attribute.- Parameters:
x
- The elements for x- Returns:
this
builder for use in a chained invocation
-
setY
Initializes the value for they
attribute.- Parameters:
y
- The elements for y- Returns:
this
builder for use in a chained invocation
-
setLink
@CanIgnoreReturnValue public final ImmutableEmpiricalFunction.Builder setLink(EmpiricalFunction.Link link) Initializes the value for thelink
attribute.If not set, this attribute will have a default value as returned by the initializer of
link
.- Parameters:
link
- The value for link- Returns:
this
builder for use in a chained invocation
-
build
Builds a newImmutableEmpiricalFunction
.- Returns:
- An immutable instance of EmpiricalFunction
- Throws:
IllegalStateException
- if any required attributes are missing
-