Package io.github.ai4ci.config
Class ImmutableExperimentConfiguration.Builder
java.lang.Object
io.github.ai4ci.config.ImmutableExperimentConfiguration.Builder
- Enclosing class:
- ImmutableExperimentConfiguration
Builds instances of type
ImmutableExperimentConfiguration
.
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 TypeMethodDescriptionaddAllFacets
(Iterable<? extends ImmutableExecutionFacet> elements) Adds elements tofacets
list.addAllSetupConfig
(Iterable<? extends ExperimentFacet.SetupFacet<?>> elements) Adds elements tosetupConfig
list.addFacet
(ImmutableExecutionFacet element) Adds one element tofacets
list.addFacets
(ImmutableExecutionFacet... elements) Adds elements tofacets
list.addSetupConfig
(ExperimentFacet.SetupFacet<?> element) Adds one element tosetupConfig
list.addSetupConfig
(ExperimentFacet.SetupFacet<?>... elements) Adds elements tosetupConfig
list.build()
Builds a newImmutableExperimentConfiguration
.from
(ExperimentConfiguration instance) Fill a builder with attribute values from the providedExperimentConfiguration
instance.from
(ModifiableExperimentConfiguration instance) Fill a builder with attribute values from the providedModifiableExperimentConfiguration
instance.setBatchConfig
(ImmutableBatchConfiguration batchConfig) Initializes the value for thebatchConfig
attribute.setExecutionConfig
(ImmutableExecutionConfiguration executionConfig) Initializes the value for theexecutionConfig
attribute.setExecutionReplications
(int executionReplications) Initializes the value for theexecutionReplications
attribute.setFacets
(Iterable<? extends ImmutableExecutionFacet> elements) Sets or replaces all elements forfacets
list.setSetupConfig
(Iterable<? extends ExperimentFacet.SetupFacet<?>> elements) Sets or replaces all elements forsetupConfig
list.setSetupReplications
(int setupReplications) Initializes the value for thesetupReplications
attribute.
-
Method Details
-
from
@CanIgnoreReturnValue public final ImmutableExperimentConfiguration.Builder from(ModifiableExperimentConfiguration instance) Fill a builder with attribute values from the providedModifiableExperimentConfiguration
instance.- Parameters:
instance
- The instance from which to copy values- Returns:
this
builder for use in a chained invocation
-
from
@CanIgnoreReturnValue public final ImmutableExperimentConfiguration.Builder from(ExperimentConfiguration instance) Fill a builder with attribute values from the providedExperimentConfiguration
instance. Regular attribute values will be replaced with those from the given instance. Absent optional values will not replace present values. Collection elements and entries will be added, not replaced.- Parameters:
instance
- The instance from which to copy values- Returns:
this
builder for use in a chained invocation
-
setBatchConfig
@CanIgnoreReturnValue public final ImmutableExperimentConfiguration.Builder setBatchConfig(ImmutableBatchConfiguration batchConfig) Initializes the value for thebatchConfig
attribute.- Parameters:
batchConfig
- The value for batchConfig- Returns:
this
builder for use in a chained invocation
-
addSetupConfig
@CanIgnoreReturnValue public final ImmutableExperimentConfiguration.Builder addSetupConfig(ExperimentFacet.SetupFacet<?> element) Adds one element tosetupConfig
list.- Parameters:
element
- A setupConfig element- Returns:
this
builder for use in a chained invocation
-
addSetupConfig
@CanIgnoreReturnValue @SafeVarargs public final ImmutableExperimentConfiguration.Builder addSetupConfig(ExperimentFacet.SetupFacet<?>... elements) Adds elements tosetupConfig
list.- Parameters:
elements
- An array of setupConfig elements- Returns:
this
builder for use in a chained invocation
-
setSetupConfig
@CanIgnoreReturnValue public final ImmutableExperimentConfiguration.Builder setSetupConfig(Iterable<? extends ExperimentFacet.SetupFacet<?>> elements) Sets or replaces all elements forsetupConfig
list.- Parameters:
elements
- An iterable of setupConfig elements- Returns:
this
builder for use in a chained invocation
-
addAllSetupConfig
@CanIgnoreReturnValue public final ImmutableExperimentConfiguration.Builder addAllSetupConfig(Iterable<? extends ExperimentFacet.SetupFacet<?>> elements) Adds elements tosetupConfig
list.- Parameters:
elements
- An iterable of setupConfig elements- Returns:
this
builder for use in a chained invocation
-
setSetupReplications
@CanIgnoreReturnValue public final ImmutableExperimentConfiguration.Builder setSetupReplications(int setupReplications) Initializes the value for thesetupReplications
attribute.- Parameters:
setupReplications
- The value for setupReplications- Returns:
this
builder for use in a chained invocation
-
setExecutionConfig
@CanIgnoreReturnValue public final ImmutableExperimentConfiguration.Builder setExecutionConfig(ImmutableExecutionConfiguration executionConfig) Initializes the value for theexecutionConfig
attribute.- Parameters:
executionConfig
- The value for executionConfig- Returns:
this
builder for use in a chained invocation
-
addFacet
@CanIgnoreReturnValue public final ImmutableExperimentConfiguration.Builder addFacet(ImmutableExecutionFacet element) Adds one element tofacets
list.- Parameters:
element
- A facets element- Returns:
this
builder for use in a chained invocation
-
addFacets
@CanIgnoreReturnValue public final ImmutableExperimentConfiguration.Builder addFacets(ImmutableExecutionFacet... elements) Adds elements tofacets
list.- Parameters:
elements
- An array of facets elements- Returns:
this
builder for use in a chained invocation
-
setFacets
@CanIgnoreReturnValue public final ImmutableExperimentConfiguration.Builder setFacets(Iterable<? extends ImmutableExecutionFacet> elements) Sets or replaces all elements forfacets
list.- Parameters:
elements
- An iterable of facets elements- Returns:
this
builder for use in a chained invocation
-
addAllFacets
@CanIgnoreReturnValue public final ImmutableExperimentConfiguration.Builder addAllFacets(Iterable<? extends ImmutableExecutionFacet> elements) Adds elements tofacets
list.- Parameters:
elements
- An iterable of facets elements- Returns:
this
builder for use in a chained invocation
-
setExecutionReplications
@CanIgnoreReturnValue public final ImmutableExperimentConfiguration.Builder setExecutionReplications(int executionReplications) Initializes the value for theexecutionReplications
attribute.- Parameters:
executionReplications
- The value for executionReplications- Returns:
this
builder for use in a chained invocation
-
build
Builds a newImmutableExperimentConfiguration
.- Returns:
- An immutable instance of ExperimentConfiguration
- Throws:
IllegalStateException
- if any required attributes are missing
-