Package com.chutneytesting.dataset.api
Class ImmutableDataSetDto.Builder
java.lang.Object
com.chutneytesting.dataset.api.ImmutableDataSetDto.Builder
- Enclosing class:
- ImmutableDataSetDto
Builds instances of type
ImmutableDataSetDto.
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 TypeMethodDescriptionaddAllConstants(Iterable<? extends KeyValue> elements) Adds elements toconstantslist.addAllDatatable(Iterable<? extends List<KeyValue>> elements) Adds elements todatatablelist.addAllTags(Iterable<String> elements) Adds elements totagslist.addConstants(KeyValue element) Adds one element toconstantslist.addConstants(KeyValue... elements) Adds elements toconstantslist.addDatatable(List<KeyValue> element) Adds one element todatatablelist.addDatatable(List<KeyValue>... elements) Adds elements todatatablelist.Adds one element totagslist.Adds elements totagslist.build()Builds a newImmutableDataSetDto.Sets or replaces all elements forconstantslist.Sets or replaces all elements fordatatablelist.description(String description) Initializes the value for thedescriptionattribute.from(DataSetDto instance) Fill a builder with attribute values from the providedDataSetDtoinstance.Initializes the optional valueidto id.Initializes the optional valueidto id.lastUpdated(Instant lastUpdated) Initializes the value for thelastUpdatedattribute.Initializes the value for thenameattribute.Sets or replaces all elements fortagslist.Initializes the value for theversionattribute.
-
Method Details
-
from
Fill a builder with attribute values from the providedDataSetDtoinstance. 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
-
name
Initializes the value for thenameattribute.- Parameters:
name- The value for name- 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
-
description
Initializes the value for thedescriptionattribute.If not set, this attribute will have a default value as returned by the initializer of
description.- Parameters:
description- The value for description- Returns:
thisbuilder for use in a chained invocation
-
lastUpdated
Initializes the value for thelastUpdatedattribute.If not set, this attribute will have a default value as returned by the initializer of
lastUpdated.- Parameters:
lastUpdated- The value for lastUpdated- 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 ImmutableDataSetDto.Builder addAllTags(Iterable<String> elements) Adds elements totagslist.- Parameters:
elements- An iterable of tags elements- Returns:
thisbuilder for use in a chained invocation
-
addConstants
Adds one element toconstantslist.- Parameters:
element- A constants element- Returns:
thisbuilder for use in a chained invocation
-
addConstants
Adds elements toconstantslist.- Parameters:
elements- An array of constants elements- Returns:
thisbuilder for use in a chained invocation
-
constants
@CanIgnoreReturnValue public final ImmutableDataSetDto.Builder constants(Iterable<? extends KeyValue> elements) Sets or replaces all elements forconstantslist.- Parameters:
elements- An iterable of constants elements- Returns:
thisbuilder for use in a chained invocation
-
addAllConstants
@CanIgnoreReturnValue public final ImmutableDataSetDto.Builder addAllConstants(Iterable<? extends KeyValue> elements) Adds elements toconstantslist.- Parameters:
elements- An iterable of constants elements- Returns:
thisbuilder for use in a chained invocation
-
addDatatable
Adds one element todatatablelist.- Parameters:
element- A datatable element- Returns:
thisbuilder for use in a chained invocation
-
addDatatable
@CanIgnoreReturnValue @SafeVarargs public final ImmutableDataSetDto.Builder addDatatable(List<KeyValue>... elements) Adds elements todatatablelist.- Parameters:
elements- An array of datatable elements- Returns:
thisbuilder for use in a chained invocation
-
datatable
@CanIgnoreReturnValue public final ImmutableDataSetDto.Builder datatable(Iterable<? extends List<KeyValue>> elements) Sets or replaces all elements fordatatablelist.- Parameters:
elements- An iterable of datatable elements- Returns:
thisbuilder for use in a chained invocation
-
addAllDatatable
@CanIgnoreReturnValue public final ImmutableDataSetDto.Builder addAllDatatable(Iterable<? extends List<KeyValue>> elements) Adds elements todatatablelist.- Parameters:
elements- An iterable of datatable elements- Returns:
thisbuilder for use in a chained invocation
-
build
Builds a newImmutableDataSetDto.- Returns:
- An immutable instance of DataSetDto
- Throws:
IllegalStateException- if any required attributes are missing
-