Package io.github.ai4ci.util
Class ImmutableTransformedDistribution.Builder
java.lang.Object
io.github.ai4ci.util.ImmutableTransformedDistribution.Builder
- Enclosing class:
- ImmutableTransformedDistribution
Builds instances of type
ImmutableTransformedDistribution
.
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 newImmutableTransformedDistribution
.from
(TransformedDistribution instance) Fill a builder with attribute values from the providedTransformedDistribution
instance.setBaseDistribution
(Abstraction.Distribution baseDistribution) Initializes the value for thebaseDistribution
attribute.setInverseLink
(DoubleUnaryOperator inverseLink) Initializes the value for theinverseLink
attribute.setLink
(DoubleUnaryOperator link) Initializes the value for thelink
attribute.
-
Method Details
-
from
@CanIgnoreReturnValue public final ImmutableTransformedDistribution.Builder from(TransformedDistribution instance) Fill a builder with attribute values from the providedTransformedDistribution
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
-
setBaseDistribution
@CanIgnoreReturnValue public final ImmutableTransformedDistribution.Builder setBaseDistribution(Abstraction.Distribution baseDistribution) Initializes the value for thebaseDistribution
attribute.- Parameters:
baseDistribution
- The value for baseDistribution- Returns:
this
builder for use in a chained invocation
-
setLink
@CanIgnoreReturnValue public final ImmutableTransformedDistribution.Builder setLink(DoubleUnaryOperator link) Initializes the value for thelink
attribute.- Parameters:
link
- The value for link- Returns:
this
builder for use in a chained invocation
-
setInverseLink
@CanIgnoreReturnValue public final ImmutableTransformedDistribution.Builder setInverseLink(DoubleUnaryOperator inverseLink) Initializes the value for theinverseLink
attribute.- Parameters:
inverseLink
- The value for inverseLink- Returns:
this
builder for use in a chained invocation
-
build
Builds a newImmutableTransformedDistribution
.- Returns:
- An immutable instance of TransformedDistribution
- Throws:
IllegalStateException
- if any required attributes are missing
-