Package fr.enedis.chutney.dataset.api
Class ImmutableDataSetDto.Builder
java.lang.Object
fr.enedis.chutney.dataset.api.ImmutableDataSetDto.Builder
- Enclosing class:
ImmutableDataSetDto
@Generated(from="DataSetDto",
generator="Immutables")
@NotThreadSafe
public static final class ImmutableDataSetDto.Builder
extends Object
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 TypeMethodDescriptionaddAllCampaignUsage(Iterable<String> elements) Adds elements tocampaignUsagelist.addAllConstants(Iterable<? extends KeyValue> elements) Adds elements toconstantslist.addAllDatatable(Iterable<? extends List<KeyValue>> elements) Adds elements todatatablelist.addAllScenarioUsage(Iterable<String> elements) Adds elements toscenarioUsagelist.addAllTags(Iterable<String> elements) Adds elements totagslist.addCampaignUsage(String element) Adds one element tocampaignUsagelist.addCampaignUsage(String... elements) Adds elements tocampaignUsagelist.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.addScenarioUsage(String element) Adds one element toscenarioUsagelist.addScenarioUsage(String... elements) Adds elements toscenarioUsagelist.Adds one element totagslist.Adds elements totagslist.build()Builds a newImmutableDataSetDto.campaignUsage(Iterable<String> elements) Sets or replaces all elements forcampaignUsagelist.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.putAllScenarioInCampaignUsage(Map<String, ? extends Set<String>> entries) Put all mappings from the specified map as entries toscenarioInCampaignUsagemap.putScenarioInCampaignUsage(String key, Set<String> value) Put one entry to thescenarioInCampaignUsagemap.putScenarioInCampaignUsage(Map.Entry<String, ? extends Set<String>> entry) Put one entry to thescenarioInCampaignUsagemap.scenarioInCampaignUsage(Map<String, ? extends Set<String>> entries) Sets or replaces all mappings from the specified map as entries for thescenarioInCampaignUsagemap.scenarioUsage(Iterable<String> elements) Sets or replaces all elements forscenarioUsagelist.Sets or replaces all elements fortagslist.
-
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
-
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
-
addScenarioUsage
Adds one element toscenarioUsagelist.- Parameters:
element- A scenarioUsage element- Returns:
thisbuilder for use in a chained invocation
-
addScenarioUsage
Adds elements toscenarioUsagelist.- Parameters:
elements- An array of scenarioUsage elements- Returns:
thisbuilder for use in a chained invocation
-
scenarioUsage
@CanIgnoreReturnValue public final ImmutableDataSetDto.Builder scenarioUsage(Iterable<String> elements) Sets or replaces all elements forscenarioUsagelist.- Parameters:
elements- An iterable of scenarioUsage elements- Returns:
thisbuilder for use in a chained invocation
-
addAllScenarioUsage
@CanIgnoreReturnValue public final ImmutableDataSetDto.Builder addAllScenarioUsage(Iterable<String> elements) Adds elements toscenarioUsagelist.- Parameters:
elements- An iterable of scenarioUsage elements- Returns:
thisbuilder for use in a chained invocation
-
addCampaignUsage
Adds one element tocampaignUsagelist.- Parameters:
element- A campaignUsage element- Returns:
thisbuilder for use in a chained invocation
-
addCampaignUsage
Adds elements tocampaignUsagelist.- Parameters:
elements- An array of campaignUsage elements- Returns:
thisbuilder for use in a chained invocation
-
campaignUsage
@CanIgnoreReturnValue public final ImmutableDataSetDto.Builder campaignUsage(Iterable<String> elements) Sets or replaces all elements forcampaignUsagelist.- Parameters:
elements- An iterable of campaignUsage elements- Returns:
thisbuilder for use in a chained invocation
-
addAllCampaignUsage
@CanIgnoreReturnValue public final ImmutableDataSetDto.Builder addAllCampaignUsage(Iterable<String> elements) Adds elements tocampaignUsagelist.- Parameters:
elements- An iterable of campaignUsage elements- Returns:
thisbuilder for use in a chained invocation
-
putScenarioInCampaignUsage
@CanIgnoreReturnValue public final ImmutableDataSetDto.Builder putScenarioInCampaignUsage(String key, Set<String> value) Put one entry to thescenarioInCampaignUsagemap.- Parameters:
key- The key in the scenarioInCampaignUsage mapvalue- The associated value in the scenarioInCampaignUsage map- Returns:
thisbuilder for use in a chained invocation
-
putScenarioInCampaignUsage
@CanIgnoreReturnValue public final ImmutableDataSetDto.Builder putScenarioInCampaignUsage(Map.Entry<String, ? extends Set<String>> entry) Put one entry to thescenarioInCampaignUsagemap. Nulls are not permitted- Parameters:
entry- The key and value entry- Returns:
thisbuilder for use in a chained invocation
-
scenarioInCampaignUsage
@CanIgnoreReturnValue public final ImmutableDataSetDto.Builder scenarioInCampaignUsage(Map<String, ? extends Set<String>> entries) Sets or replaces all mappings from the specified map as entries for thescenarioInCampaignUsagemap. Nulls are not permitted- Parameters:
entries- The entries that will be added to the scenarioInCampaignUsage map- Returns:
thisbuilder for use in a chained invocation
-
putAllScenarioInCampaignUsage
@CanIgnoreReturnValue public final ImmutableDataSetDto.Builder putAllScenarioInCampaignUsage(Map<String, ? extends Set<String>> entries) Put all mappings from the specified map as entries toscenarioInCampaignUsagemap. Nulls are not permitted- Parameters:
entries- The entries that will be added to the scenarioInCampaignUsage map- 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
-