Class ImmutableComposableScenarioDto.Builder
java.lang.Object
com.chutneytesting.component.scenario.api.dto.ImmutableComposableScenarioDto.Builder
- Enclosing class:
- ImmutableComposableScenarioDto
Builds instances of type
ImmutableComposableScenarioDto.
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 TypeMethodDescriptionaddAllComponentSteps(Iterable<? extends ComposableStepDto> elements) Adds elements tocomponentStepslist.addAllParameters(Iterable<? extends KeyValue> elements) Adds elements toparameterslist.addComponentSteps(ComposableStepDto element) Adds one element tocomponentStepslist.addComponentSteps(ComposableStepDto... elements) Adds elements tocomponentStepslist.addParameters(KeyValue element) Adds one element toparameterslist.addParameters(KeyValue... elements) Adds elements toparameterslist.build()Builds a newImmutableComposableScenarioDto.componentSteps(Iterable<? extends ComposableStepDto> elements) Sets or replaces all elements forcomponentStepslist.Fill a builder with attribute values from the providedComposableScenarioDtoinstance.parameters(Iterable<? extends KeyValue> elements) Sets or replaces all elements forparameterslist.
-
Method Details
-
from
@CanIgnoreReturnValue public final ImmutableComposableScenarioDto.Builder from(ComposableTestCaseDto.ComposableScenarioDto instance) Fill a builder with attribute values from the providedComposableScenarioDtoinstance. 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:
thisbuilder for use in a chained invocation
-
addParameters
@CanIgnoreReturnValue public final ImmutableComposableScenarioDto.Builder addParameters(KeyValue element) Adds one element toparameterslist.- Parameters:
element- A parameters element- Returns:
thisbuilder for use in a chained invocation
-
addParameters
@CanIgnoreReturnValue public final ImmutableComposableScenarioDto.Builder addParameters(KeyValue... elements) Adds elements toparameterslist.- Parameters:
elements- An array of parameters elements- Returns:
thisbuilder for use in a chained invocation
-
parameters
@CanIgnoreReturnValue public final ImmutableComposableScenarioDto.Builder parameters(Iterable<? extends KeyValue> elements) Sets or replaces all elements forparameterslist.- Parameters:
elements- An iterable of parameters elements- Returns:
thisbuilder for use in a chained invocation
-
addAllParameters
@CanIgnoreReturnValue public final ImmutableComposableScenarioDto.Builder addAllParameters(Iterable<? extends KeyValue> elements) Adds elements toparameterslist.- Parameters:
elements- An iterable of parameters elements- Returns:
thisbuilder for use in a chained invocation
-
addComponentSteps
@CanIgnoreReturnValue public final ImmutableComposableScenarioDto.Builder addComponentSteps(ComposableStepDto element) Adds one element tocomponentStepslist.- Parameters:
element- A componentSteps element- Returns:
thisbuilder for use in a chained invocation
-
addComponentSteps
@CanIgnoreReturnValue public final ImmutableComposableScenarioDto.Builder addComponentSteps(ComposableStepDto... elements) Adds elements tocomponentStepslist.- Parameters:
elements- An array of componentSteps elements- Returns:
thisbuilder for use in a chained invocation
-
componentSteps
@CanIgnoreReturnValue public final ImmutableComposableScenarioDto.Builder componentSteps(Iterable<? extends ComposableStepDto> elements) Sets or replaces all elements forcomponentStepslist.- Parameters:
elements- An iterable of componentSteps elements- Returns:
thisbuilder for use in a chained invocation
-
addAllComponentSteps
@CanIgnoreReturnValue public final ImmutableComposableScenarioDto.Builder addAllComponentSteps(Iterable<? extends ComposableStepDto> elements) Adds elements tocomponentStepslist.- Parameters:
elements- An iterable of componentSteps elements- Returns:
thisbuilder for use in a chained invocation
-
build
Builds a newImmutableComposableScenarioDto.- Returns:
- An immutable instance of ComposableScenarioDto
- Throws:
IllegalStateException- if any required attributes are missing
-