Package io.github.ai4ci.config
Class ImmutableBatchConfiguration.Builder
java.lang.Object
io.github.ai4ci.config.ImmutableBatchConfiguration.Builder
- Enclosing class:
- ImmutableBatchConfiguration
Builds instances of type
ImmutableBatchConfiguration
.
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 newImmutableBatchConfiguration
.from
(BatchConfiguration instance) Fill a builder with attribute values from the providedBatchConfiguration
instance.setExporters
(Exporters... exporters) Initializes the value for theexporters
attribute.setSimulationDuration
(int simulationDuration) Initializes the value for thesimulationDuration
attribute.setUrnBase
(String urnBase) Initializes the value for theurnBase
attribute.
-
Method Details
-
from
@CanIgnoreReturnValue public final ImmutableBatchConfiguration.Builder from(BatchConfiguration instance) Fill a builder with attribute values from the providedBatchConfiguration
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
-
setUrnBase
Initializes the value for theurnBase
attribute.If not set, this attribute will have a default value as returned by the initializer of
urnBase
.- Parameters:
urnBase
- The value for urnBase- Returns:
this
builder for use in a chained invocation
-
setSimulationDuration
@CanIgnoreReturnValue public final ImmutableBatchConfiguration.Builder setSimulationDuration(int simulationDuration) Initializes the value for thesimulationDuration
attribute.- Parameters:
simulationDuration
- The value for simulationDuration- Returns:
this
builder for use in a chained invocation
-
setExporters
@CanIgnoreReturnValue public final ImmutableBatchConfiguration.Builder setExporters(Exporters... exporters) Initializes the value for theexporters
attribute.If not set, this attribute will have a default value as defined by
exporters
.- Parameters:
exporters
- The elements for exporters- Returns:
this
builder for use in a chained invocation
-
build
Builds a newImmutableBatchConfiguration
.- Returns:
- An immutable instance of BatchConfiguration
- Throws:
IllegalStateException
- if any required attributes are missing
-