Class ImmutableRawTestCaseDto.Builder
java.lang.Object
com.chutneytesting.scenario.api.raw.dto.ImmutableRawTestCaseDto.Builder
- Enclosing class:
- ImmutableRawTestCaseDto
Builds instances of type
ImmutableRawTestCaseDto.
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 TypeMethodDescriptionaddAllParameters(Iterable<? extends KeyValue> elements) Adds elements toparameterslist.addAllTags(Iterable<String> elements) Adds elements totagslist.addParameters(KeyValue element) Adds one element toparameterslist.addParameters(KeyValue... elements) Adds elements toparameterslist.Adds one element totagslist.Adds elements totagslist.Initializes the value for theauthorattribute.build()Builds a newImmutableRawTestCaseDto.creationDate(Instant creationDate) Initializes the value for thecreationDateattribute.defaultDataset(String defaultDataset) Initializes the optional valuedefaultDatasetto defaultDataset.defaultDataset(Optional<String> defaultDataset) Initializes the optional valuedefaultDatasetto defaultDataset.description(String description) Initializes the optional valuedescriptionto description.description(Optional<String> description) Initializes the optional valuedescriptionto description.from(RawTestCaseDto instance) Fill a builder with attribute values from the providedRawTestCaseDtoinstance.Initializes the optional valueidto id.Initializes the optional valueidto id.parameters(Iterable<? extends KeyValue> elements) Sets or replaces all elements forparameterslist.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
Fill a builder with attribute values from the providedRawTestCaseDtoinstance. 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
-
scenario
Initializes the value for thescenarioattribute.- Parameters:
scenario- The value for scenario- 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
Initializes the optional valuedescriptionto description.- Parameters:
description- The value for description- Returns:
thisbuilder for chained invocation
-
description
@CanIgnoreReturnValue public final ImmutableRawTestCaseDto.Builder description(Optional<String> description) Initializes the optional valuedescriptionto description.- Parameters:
description- The value for description- 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
Adds elements totagslist.- Parameters:
elements- An array of tags elements- Returns:
thisbuilder for use in a chained invocation
-
tags
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 ImmutableRawTestCaseDto.Builder addAllTags(Iterable<String> elements) Adds elements totagslist.- Parameters:
elements- An iterable of tags elements- Returns:
thisbuilder for use in a chained invocation
-
defaultDataset
@CanIgnoreReturnValue public final ImmutableRawTestCaseDto.Builder defaultDataset(String defaultDataset) Initializes the optional valuedefaultDatasetto defaultDataset.- Parameters:
defaultDataset- The value for defaultDataset- Returns:
thisbuilder for chained invocation
-
defaultDataset
@CanIgnoreReturnValue public final ImmutableRawTestCaseDto.Builder defaultDataset(Optional<String> defaultDataset) Initializes the optional valuedefaultDatasetto defaultDataset.- Parameters:
defaultDataset- The value for defaultDataset- Returns:
thisbuilder for use in a chained invocation
-
creationDate
@CanIgnoreReturnValue public final ImmutableRawTestCaseDto.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
-
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
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
-
addParameters
Adds one element toparameterslist.- Parameters:
element- A parameters element- Returns:
thisbuilder for use in a chained invocation
-
addParameters
@CanIgnoreReturnValue public final ImmutableRawTestCaseDto.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 ImmutableRawTestCaseDto.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 ImmutableRawTestCaseDto.Builder addAllParameters(Iterable<? extends KeyValue> elements) Adds elements toparameterslist.- Parameters:
elements- An iterable of parameters elements- Returns:
thisbuilder for use in a chained invocation
-
build
Builds a newImmutableRawTestCaseDto.- Returns:
- An immutable instance of RawTestCaseDto
- Throws:
IllegalStateException- if any required attributes are missing
-