Package io.dialob.executor.model
Class ImmutableItemStates.Builder
- java.lang.Object
-
- io.dialob.executor.model.ImmutableItemStates.Builder
-
- Enclosing class:
- ImmutableItemStates
@NotThreadSafe public static final class ImmutableItemStates.Builder extends Object
Builds instances of typeImmutableItemStates. 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 ImmutableItemStatesbuild()Builds a newImmutableItemStates.ImmutableItemStates.BuildererrorStates(Map<? extends ErrorId,? extends ErrorState> entries)Sets or replaces all mappings from the specified map as entries for theerrorStatesmap.ImmutableItemStates.Builderfrom(ItemStates instance)Fill a builder with attribute values from the providedItemStatesinstance.ImmutableItemStates.BuilderitemStates(Map<? extends ItemId,? extends ItemState> entries)Sets or replaces all mappings from the specified map as entries for theitemStatesmap.ImmutableItemStates.BuilderputAllErrorStates(Map<? extends ErrorId,? extends ErrorState> entries)Put all mappings from the specified map as entries toerrorStatesmap.ImmutableItemStates.BuilderputAllItemStates(Map<? extends ItemId,? extends ItemState> entries)Put all mappings from the specified map as entries toitemStatesmap.ImmutableItemStates.BuilderputAllValueSetStates(Map<? extends ValueSetId,? extends ValueSetState> entries)Put all mappings from the specified map as entries tovalueSetStatesmap.ImmutableItemStates.BuilderputErrorStates(ErrorId key, ErrorState value)Put one entry to theerrorStatesmap.ImmutableItemStates.BuilderputErrorStates(Map.Entry<? extends ErrorId,? extends ErrorState> entry)Put one entry to theerrorStatesmap.ImmutableItemStates.BuilderputItemStates(ItemId key, ItemState value)Put one entry to theitemStatesmap.ImmutableItemStates.BuilderputItemStates(Map.Entry<? extends ItemId,? extends ItemState> entry)Put one entry to theitemStatesmap.ImmutableItemStates.BuilderputValueSetStates(ValueSetId key, ValueSetState value)Put one entry to thevalueSetStatesmap.ImmutableItemStates.BuilderputValueSetStates(Map.Entry<? extends ValueSetId,? extends ValueSetState> entry)Put one entry to thevalueSetStatesmap.ImmutableItemStates.BuildervalueSetStates(Map<? extends ValueSetId,? extends ValueSetState> entries)Sets or replaces all mappings from the specified map as entries for thevalueSetStatesmap.
-
-
-
Method Detail
-
from
@CanIgnoreReturnValue public final ImmutableItemStates.Builder from(ItemStates instance)
Fill a builder with attribute values from the providedItemStatesinstance. 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
-
putItemStates
@CanIgnoreReturnValue public final ImmutableItemStates.Builder putItemStates(ItemId key, ItemState value)
Put one entry to theitemStatesmap.- Parameters:
key- The key in the itemStates mapvalue- The associated value in the itemStates map- Returns:
thisbuilder for use in a chained invocation
-
putItemStates
@CanIgnoreReturnValue public final ImmutableItemStates.Builder putItemStates(Map.Entry<? extends ItemId,? extends ItemState> entry)
Put one entry to theitemStatesmap. Nulls are not permitted- Parameters:
entry- The key and value entry- Returns:
thisbuilder for use in a chained invocation
-
itemStates
@CanIgnoreReturnValue public final ImmutableItemStates.Builder itemStates(Map<? extends ItemId,? extends ItemState> entries)
Sets or replaces all mappings from the specified map as entries for theitemStatesmap. Nulls are not permitted- Parameters:
entries- The entries that will be added to the itemStates map- Returns:
thisbuilder for use in a chained invocation
-
putAllItemStates
@CanIgnoreReturnValue public final ImmutableItemStates.Builder putAllItemStates(Map<? extends ItemId,? extends ItemState> entries)
Put all mappings from the specified map as entries toitemStatesmap. Nulls are not permitted- Parameters:
entries- The entries that will be added to the itemStates map- Returns:
thisbuilder for use in a chained invocation
-
putValueSetStates
@CanIgnoreReturnValue public final ImmutableItemStates.Builder putValueSetStates(ValueSetId key, ValueSetState value)
Put one entry to thevalueSetStatesmap.- Parameters:
key- The key in the valueSetStates mapvalue- The associated value in the valueSetStates map- Returns:
thisbuilder for use in a chained invocation
-
putValueSetStates
@CanIgnoreReturnValue public final ImmutableItemStates.Builder putValueSetStates(Map.Entry<? extends ValueSetId,? extends ValueSetState> entry)
Put one entry to thevalueSetStatesmap. Nulls are not permitted- Parameters:
entry- The key and value entry- Returns:
thisbuilder for use in a chained invocation
-
valueSetStates
@CanIgnoreReturnValue public final ImmutableItemStates.Builder valueSetStates(Map<? extends ValueSetId,? extends ValueSetState> entries)
Sets or replaces all mappings from the specified map as entries for thevalueSetStatesmap. Nulls are not permitted- Parameters:
entries- The entries that will be added to the valueSetStates map- Returns:
thisbuilder for use in a chained invocation
-
putAllValueSetStates
@CanIgnoreReturnValue public final ImmutableItemStates.Builder putAllValueSetStates(Map<? extends ValueSetId,? extends ValueSetState> entries)
Put all mappings from the specified map as entries tovalueSetStatesmap. Nulls are not permitted- Parameters:
entries- The entries that will be added to the valueSetStates map- Returns:
thisbuilder for use in a chained invocation
-
putErrorStates
@CanIgnoreReturnValue public final ImmutableItemStates.Builder putErrorStates(ErrorId key, ErrorState value)
Put one entry to theerrorStatesmap.- Parameters:
key- The key in the errorStates mapvalue- The associated value in the errorStates map- Returns:
thisbuilder for use in a chained invocation
-
putErrorStates
@CanIgnoreReturnValue public final ImmutableItemStates.Builder putErrorStates(Map.Entry<? extends ErrorId,? extends ErrorState> entry)
Put one entry to theerrorStatesmap. Nulls are not permitted- Parameters:
entry- The key and value entry- Returns:
thisbuilder for use in a chained invocation
-
errorStates
@CanIgnoreReturnValue public final ImmutableItemStates.Builder errorStates(Map<? extends ErrorId,? extends ErrorState> entries)
Sets or replaces all mappings from the specified map as entries for theerrorStatesmap. Nulls are not permitted- Parameters:
entries- The entries that will be added to the errorStates map- Returns:
thisbuilder for use in a chained invocation
-
putAllErrorStates
@CanIgnoreReturnValue public final ImmutableItemStates.Builder putAllErrorStates(Map<? extends ErrorId,? extends ErrorState> entries)
Put all mappings from the specified map as entries toerrorStatesmap. Nulls are not permitted- Parameters:
entries- The entries that will be added to the errorStates map- Returns:
thisbuilder for use in a chained invocation
-
build
public ImmutableItemStates build()
Builds a newImmutableItemStates.- Returns:
- An immutable instance of ItemStates
- Throws:
IllegalStateException- if any required attributes are missing
-
-