Class ImmutableDataSetDto.Builder
- java.lang.Object
-
- com.chutneytesting.component.dataset.api.ImmutableDataSetDto.Builder
-
- Enclosing class:
- ImmutableDataSetDto
@NotThreadSafe public static final class ImmutableDataSetDto.Builder extends Object
Builds instances of typeImmutableDataSetDto. 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 ImmutableDataSetDto.Builder from(DataSetDto instance)
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
@CanIgnoreReturnValue public final ImmutableDataSetDto.Builder id(String id)
Initializes the optional valueidto id.- Parameters:
id- The value for id- Returns:
thisbuilder for chained invocation
-
id
@CanIgnoreReturnValue public final ImmutableDataSetDto.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 ImmutableDataSetDto.Builder name(String name)
Initializes the value for thenameattribute.- Parameters:
name- The value for name- Returns:
thisbuilder for use in a chained invocation
-
version
@CanIgnoreReturnValue public final ImmutableDataSetDto.Builder version(Integer 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
@CanIgnoreReturnValue public final ImmutableDataSetDto.Builder description(String 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
@CanIgnoreReturnValue public final ImmutableDataSetDto.Builder lastUpdated(Instant 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
@CanIgnoreReturnValue public final ImmutableDataSetDto.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 ImmutableDataSetDto.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 ImmutableDataSetDto.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 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
@CanIgnoreReturnValue public final ImmutableDataSetDto.Builder addConstants(KeyValue element)
Adds one element toconstantslist.- Parameters:
element- A constants element- Returns:
thisbuilder for use in a chained invocation
-
addConstants
@CanIgnoreReturnValue public final ImmutableDataSetDto.Builder addConstants(KeyValue... elements)
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
@CanIgnoreReturnValue public final ImmutableDataSetDto.Builder addDatatable(List<KeyValue> element)
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
public ImmutableDataSetDto build()
Builds a newImmutableDataSetDto.- Returns:
- An immutable instance of DataSetDto
- Throws:
IllegalStateException- if any required attributes are missing
-
-