Class ImmutableComposableStepDto.Builder
- java.lang.Object
-
- com.chutneytesting.component.scenario.api.dto.ImmutableComposableStepDto.Builder
-
- Enclosing class:
- ImmutableComposableStepDto
@NotThreadSafe public static final class ImmutableComposableStepDto.Builder extends Object
Builds instances of typeImmutableComposableStepDto. Initialize attributes and then invoke thebuild()method to create an immutable instance.Builderis not thread-safe and generally should not be stored in a field or collection, but instead used immediately to create instances.
-
-
Method Summary
-
-
-
Method Detail
-
from
@CanIgnoreReturnValue public final ImmutableComposableStepDto.Builder from(ComposableStepDto instance)
Fill a builder with attribute values from the providedComposableStepDtoinstance. 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
-
id
@CanIgnoreReturnValue public final ImmutableComposableStepDto.Builder id(String id)
Initializes the optional valueidto id.- Parameters:
id- The value for id- Returns:
thisbuilder for chained invocation
-
id
@CanIgnoreReturnValue public final ImmutableComposableStepDto.Builder id(Optional<String> id)
Initializes the optional valueidto id.- Parameters:
id- The value for id- Returns:
thisbuilder for use in a chained invocation
-
name
@CanIgnoreReturnValue public final ImmutableComposableStepDto.Builder name(String name)
Initializes the value for thenameattribute.- Parameters:
name- The value for name- Returns:
thisbuilder for use in a chained invocation
-
strategy
@CanIgnoreReturnValue public final ImmutableComposableStepDto.Builder strategy(StrategyDto strategy)
Initializes the value for thestrategyattribute.If not set, this attribute will have a default value as returned by the initializer of
strategy.- Parameters:
strategy- The value for strategy- Returns:
thisbuilder for use in a chained invocation
-
usage
@CanIgnoreReturnValue public final ImmutableComposableStepDto.Builder usage(ComposableStepDto.StepUsage usage)
Initializes the value for theusageattribute.If not set, this attribute will have a default value as returned by the initializer of
usage.- Parameters:
usage- The value for usage- Returns:
thisbuilder for use in a chained invocation
-
task
@CanIgnoreReturnValue public final ImmutableComposableStepDto.Builder task(String task)
Initializes the optional valuetaskto task.- Parameters:
task- The value for task- Returns:
thisbuilder for chained invocation
-
task
@CanIgnoreReturnValue public final ImmutableComposableStepDto.Builder task(Optional<String> task)
Initializes the optional valuetaskto task.- Parameters:
task- The value for task- Returns:
thisbuilder for use in a chained invocation
-
addSteps
@CanIgnoreReturnValue public final ImmutableComposableStepDto.Builder addSteps(ComposableStepDto element)
Adds one element tostepslist.- Parameters:
element- A steps element- Returns:
thisbuilder for use in a chained invocation
-
addSteps
@CanIgnoreReturnValue public final ImmutableComposableStepDto.Builder addSteps(ComposableStepDto... elements)
Adds elements tostepslist.- Parameters:
elements- An array of steps elements- Returns:
thisbuilder for use in a chained invocation
-
steps
@CanIgnoreReturnValue public final ImmutableComposableStepDto.Builder steps(Iterable<? extends ComposableStepDto> elements)
Sets or replaces all elements forstepslist.- Parameters:
elements- An iterable of steps elements- Returns:
thisbuilder for use in a chained invocation
-
addAllSteps
@CanIgnoreReturnValue public final ImmutableComposableStepDto.Builder addAllSteps(Iterable<? extends ComposableStepDto> elements)
Adds elements tostepslist.- Parameters:
elements- An iterable of steps elements- Returns:
thisbuilder for use in a chained invocation
-
addDefaultParameters
@CanIgnoreReturnValue public final ImmutableComposableStepDto.Builder addDefaultParameters(KeyValue element)
Adds one element todefaultParameterslist.- Parameters:
element- A defaultParameters element- Returns:
thisbuilder for use in a chained invocation
-
addDefaultParameters
@CanIgnoreReturnValue public final ImmutableComposableStepDto.Builder addDefaultParameters(KeyValue... elements)
Adds elements todefaultParameterslist.- Parameters:
elements- An array of defaultParameters elements- Returns:
thisbuilder for use in a chained invocation
-
defaultParameters
@CanIgnoreReturnValue public final ImmutableComposableStepDto.Builder defaultParameters(Iterable<? extends KeyValue> elements)
Sets or replaces all elements fordefaultParameterslist.- Parameters:
elements- An iterable of defaultParameters elements- Returns:
thisbuilder for use in a chained invocation
-
addAllDefaultParameters
@CanIgnoreReturnValue public final ImmutableComposableStepDto.Builder addAllDefaultParameters(Iterable<? extends KeyValue> elements)
Adds elements todefaultParameterslist.- Parameters:
elements- An iterable of defaultParameters elements- Returns:
thisbuilder for use in a chained invocation
-
addExecutionParameters
@CanIgnoreReturnValue public final ImmutableComposableStepDto.Builder addExecutionParameters(KeyValue element)
Adds one element toexecutionParameterslist.- Parameters:
element- A executionParameters element- Returns:
thisbuilder for use in a chained invocation
-
addExecutionParameters
@CanIgnoreReturnValue public final ImmutableComposableStepDto.Builder addExecutionParameters(KeyValue... elements)
Adds elements toexecutionParameterslist.- Parameters:
elements- An array of executionParameters elements- Returns:
thisbuilder for use in a chained invocation
-
executionParameters
@CanIgnoreReturnValue public final ImmutableComposableStepDto.Builder executionParameters(Iterable<? extends KeyValue> elements)
Sets or replaces all elements forexecutionParameterslist.- Parameters:
elements- An iterable of executionParameters elements- Returns:
thisbuilder for use in a chained invocation
-
addAllExecutionParameters
@CanIgnoreReturnValue public final ImmutableComposableStepDto.Builder addAllExecutionParameters(Iterable<? extends KeyValue> elements)
Adds elements toexecutionParameterslist.- Parameters:
elements- An iterable of executionParameters elements- Returns:
thisbuilder for use in a chained invocation
-
addTags
@CanIgnoreReturnValue public final ImmutableComposableStepDto.Builder addTags(String element)
Adds one element totagslist.- Parameters:
element- A tags element- Returns:
thisbuilder for use in a chained invocation
-
addTags
@CanIgnoreReturnValue public final ImmutableComposableStepDto.Builder addTags(String... elements)
Adds elements totagslist.- Parameters:
elements- An array of tags elements- Returns:
thisbuilder for use in a chained invocation
-
tags
@CanIgnoreReturnValue public final ImmutableComposableStepDto.Builder tags(Iterable<String> elements)
Sets or replaces all elements fortagslist.- Parameters:
elements- An iterable of tags elements- Returns:
thisbuilder for use in a chained invocation
-
addAllTags
@CanIgnoreReturnValue public final ImmutableComposableStepDto.Builder addAllTags(Iterable<String> elements)
Adds elements totagslist.- Parameters:
elements- An iterable of tags elements- Returns:
thisbuilder for use in a chained invocation
-
build
public ImmutableComposableStepDto build()
Builds a newImmutableComposableStepDto.- Returns:
- An immutable instance of ComposableStepDto
- Throws:
IllegalStateException- if any required attributes are missing
-
-