Class ImmutableStrategyDto.Builder
java.lang.Object
com.chutneytesting.component.scenario.api.dto.ImmutableStrategyDto.Builder
- Enclosing class:
- ImmutableStrategyDto
Builds instances of type
ImmutableStrategyDto.
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 TypeMethodDescriptionbuild()Builds a newImmutableStrategyDto.from(StrategyDto instance) Fill a builder with attribute values from the providedStrategyDtoinstance.parameters(Map<String, ? extends Object> entries) Sets or replaces all mappings from the specified map as entries for theparametersmap.putAllParameters(Map<String, ? extends Object> entries) Put all mappings from the specified map as entries toparametersmap.putParameters(String key, Object value) Put one entry to theparametersmap.putParameters(Map.Entry<String, ? extends Object> entry) Put one entry to theparametersmap.Initializes the value for thetypeattribute.
-
Method Details
-
from
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
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
Builds a newImmutableStrategyDto.- Returns:
- An immutable instance of StrategyDto
- Throws:
IllegalStateException- if any required attributes are missing
-