Class ImmutableComposableTestCaseDto.Builder
java.lang.Object
com.chutneytesting.component.scenario.api.dto.ImmutableComposableTestCaseDto.Builder
- Enclosing class:
- ImmutableComposableTestCaseDto
Builds instances of type
ImmutableComposableTestCaseDto.
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 TypeMethodDescriptionaddAllExecutionParameters(Iterable<? extends KeyValue> elements) Adds elements toexecutionParameterslist.addAllTags(Iterable<String> elements) Adds elements totagslist.addExecutionParameters(KeyValue element) Adds one element toexecutionParameterslist.addExecutionParameters(KeyValue... elements) Adds elements toexecutionParameterslist.Adds one element totagslist.Adds elements totagslist.Initializes the value for theauthorattribute.build()Builds a newImmutableComposableTestCaseDto.creationDate(Instant creationDate) Initializes the value for thecreationDateattribute.Initializes the optional valuedatasetIdto datasetId.Initializes the optional valuedatasetIdto datasetId.description(String description) Initializes the optional valuedescriptionto description.description(Optional<String> description) Initializes the optional valuedescriptionto description.executionParameters(Iterable<? extends KeyValue> elements) Sets or replaces all elements forexecutionParameterslist.from(ComposableTestCaseDto instance) Fill a builder with attribute values from the providedComposableTestCaseDtoinstance.Initializes the optional valueidto id.Initializes the optional valueidto id.Initializes the value for thescenarioattribute.Sets or replaces all elements fortagslist.Initializes the value for thetitleattribute.updateDate(Instant updateDate) Initializes the value for theupdateDateattribute.Initializes the value for theversionattribute.
-
Method Details
-
from
@CanIgnoreReturnValue public final ImmutableComposableTestCaseDto.Builder from(ComposableTestCaseDto instance) Fill a builder with attribute values from the providedComposableTestCaseDtoinstance. 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
Initializes the optional valueidto id.- Parameters:
id- The value for id- Returns:
thisbuilder for chained invocation
-
id
Initializes the optional valueidto id.- Parameters:
id- The value for id- Returns:
thisbuilder for use in a chained invocation
-
title
Initializes the value for thetitleattribute.- Parameters:
title- The value for title- Returns:
thisbuilder for use in a chained invocation
-
description
@CanIgnoreReturnValue public final ImmutableComposableTestCaseDto.Builder description(String description) Initializes the optional valuedescriptionto description.- Parameters:
description- The value for description- Returns:
thisbuilder for chained invocation
-
description
@CanIgnoreReturnValue public final ImmutableComposableTestCaseDto.Builder description(Optional<String> description) Initializes the optional valuedescriptionto description.- Parameters:
description- The value for description- Returns:
thisbuilder for use in a chained invocation
-
creationDate
@CanIgnoreReturnValue public final ImmutableComposableTestCaseDto.Builder creationDate(Instant creationDate) Initializes the value for thecreationDateattribute.If not set, this attribute will have a default value as returned by the initializer of
creationDate.- Parameters:
creationDate- The value for creationDate- Returns:
thisbuilder for use in a chained invocation
-
addTags
Adds one element totagslist.- Parameters:
element- A tags element- Returns:
thisbuilder for use in a chained invocation
-
addTags
@CanIgnoreReturnValue public final ImmutableComposableTestCaseDto.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 ImmutableComposableTestCaseDto.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 ImmutableComposableTestCaseDto.Builder addAllTags(Iterable<String> elements) Adds elements totagslist.- Parameters:
elements- An iterable of tags elements- Returns:
thisbuilder for use in a chained invocation
-
scenario
@CanIgnoreReturnValue public final ImmutableComposableTestCaseDto.Builder scenario(ComposableTestCaseDto.ComposableScenarioDto scenario) Initializes the value for thescenarioattribute.- Parameters:
scenario- The value for scenario- Returns:
thisbuilder for use in a chained invocation
-
datasetId
@CanIgnoreReturnValue public final ImmutableComposableTestCaseDto.Builder datasetId(String datasetId) Initializes the optional valuedatasetIdto datasetId.- Parameters:
datasetId- The value for datasetId- Returns:
thisbuilder for chained invocation
-
datasetId
@CanIgnoreReturnValue public final ImmutableComposableTestCaseDto.Builder datasetId(Optional<String> datasetId) Initializes the optional valuedatasetIdto datasetId.- Parameters:
datasetId- The value for datasetId- Returns:
thisbuilder for use in a chained invocation
-
author
Initializes the value for theauthorattribute.If not set, this attribute will have a default value as returned by the initializer of
author.- Parameters:
author- The value for author- Returns:
thisbuilder for use in a chained invocation
-
updateDate
@CanIgnoreReturnValue public final ImmutableComposableTestCaseDto.Builder updateDate(Instant updateDate) Initializes the value for theupdateDateattribute.If not set, this attribute will have a default value as returned by the initializer of
updateDate.- Parameters:
updateDate- The value for updateDate- Returns:
thisbuilder for use in a chained invocation
-
version
Initializes the value for theversionattribute.If not set, this attribute will have a default value as returned by the initializer of
version.- Parameters:
version- The value for version- Returns:
thisbuilder for use in a chained invocation
-
addExecutionParameters
@CanIgnoreReturnValue public final ImmutableComposableTestCaseDto.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 ImmutableComposableTestCaseDto.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 ImmutableComposableTestCaseDto.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 ImmutableComposableTestCaseDto.Builder addAllExecutionParameters(Iterable<? extends KeyValue> elements) Adds elements toexecutionParameterslist.- Parameters:
elements- An iterable of executionParameters elements- Returns:
thisbuilder for use in a chained invocation
-
build
Builds a newImmutableComposableTestCaseDto.- Returns:
- An immutable instance of ComposableTestCaseDto
- Throws:
IllegalStateException- if any required attributes are missing
-