Class ImmutableStrategyDto.Builder
- java.lang.Object
-
- com.chutneytesting.component.scenario.api.dto.ImmutableStrategyDto.Builder
-
- Enclosing class:
- ImmutableStrategyDto
@NotThreadSafe public static final class ImmutableStrategyDto.Builder extends Object
Builds instances of typeImmutableStrategyDto. 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
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ImmutableStrategyDtobuild()Builds a newImmutableStrategyDto.ImmutableStrategyDto.Builderfrom(StrategyDto instance)Fill a builder with attribute values from the providedStrategyDtoinstance.ImmutableStrategyDto.Builderparameters(Map<String,? extends Object> entries)Sets or replaces all mappings from the specified map as entries for theparametersmap.ImmutableStrategyDto.BuilderputAllParameters(Map<String,? extends Object> entries)Put all mappings from the specified map as entries toparametersmap.ImmutableStrategyDto.BuilderputParameters(String key, Object value)Put one entry to theparametersmap.ImmutableStrategyDto.BuilderputParameters(Map.Entry<String,? extends Object> entry)Put one entry to theparametersmap.ImmutableStrategyDto.Buildertype(String type)Initializes the value for thetypeattribute.
-
-
-
Method Detail
-
from
@CanIgnoreReturnValue public final ImmutableStrategyDto.Builder from(StrategyDto instance)
Fill a builder with attribute values from the providedStrategyDtoinstance. 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
-
type
@CanIgnoreReturnValue public final ImmutableStrategyDto.Builder type(String type)
Initializes the value for thetypeattribute.If not set, this attribute will have a default value as returned by the initializer of
type.- Parameters:
type- The value for type- Returns:
thisbuilder for use in a chained invocation
-
putParameters
@CanIgnoreReturnValue public final ImmutableStrategyDto.Builder putParameters(String key, Object value)
Put one entry to theparametersmap.- Parameters:
key- The key in the parameters mapvalue- The associated value in the parameters map- Returns:
thisbuilder for use in a chained invocation
-
putParameters
@CanIgnoreReturnValue public final ImmutableStrategyDto.Builder putParameters(Map.Entry<String,? extends Object> entry)
Put one entry to theparametersmap. Nulls are not permitted- Parameters:
entry- The key and value entry- Returns:
thisbuilder for use in a chained invocation
-
parameters
@CanIgnoreReturnValue public final ImmutableStrategyDto.Builder parameters(Map<String,? extends Object> entries)
Sets or replaces all mappings from the specified map as entries for theparametersmap. Nulls are not permitted- Parameters:
entries- The entries that will be added to the parameters map- Returns:
thisbuilder for use in a chained invocation
-
putAllParameters
@CanIgnoreReturnValue public final ImmutableStrategyDto.Builder putAllParameters(Map<String,? extends Object> entries)
Put all mappings from the specified map as entries toparametersmap. Nulls are not permitted- Parameters:
entries- The entries that will be added to the parameters map- Returns:
thisbuilder for use in a chained invocation
-
build
public ImmutableStrategyDto build()
Builds a newImmutableStrategyDto.- Returns:
- An immutable instance of StrategyDto
- Throws:
IllegalStateException- if any required attributes are missing
-
-