Package io.dialob.executor.command
Class ImmutableSetLocale.Builder
- java.lang.Object
-
- io.dialob.executor.command.ImmutableSetLocale.Builder
-
- Enclosing class:
- ImmutableSetLocale
@NotThreadSafe public static final class ImmutableSetLocale.Builder extends Object
Builds instances of typeImmutableSetLocale. 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 ImmutableSetLocale.BuilderaddAllTriggers(Iterable<? extends Trigger<ItemState>> elements)Adds elements totriggerslist.ImmutableSetLocale.BuilderaddTriggers(Trigger<ItemState> element)Adds one element totriggerslist.ImmutableSetLocale.BuilderaddTriggers(Trigger<ItemState>... elements)Adds elements totriggerslist.ImmutableSetLocalebuild()Builds a newImmutableSetLocale.ImmutableSetLocale.Builderfrom(SetLocale instance)Fill a builder with attribute values from the providedSetLocaleinstance.ImmutableSetLocale.Builderlocale(String locale)Initializes the value for thelocaleattribute.ImmutableSetLocale.BuildertargetId(ItemId targetId)Initializes the value for thetargetIdattribute.ImmutableSetLocale.Buildertriggers(Iterable<? extends Trigger<ItemState>> elements)Sets or replaces all elements fortriggerslist.
-
-
-
Method Detail
-
from
@CanIgnoreReturnValue public final ImmutableSetLocale.Builder from(SetLocale instance)
Fill a builder with attribute values from the providedSetLocaleinstance. 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
-
addTriggers
@CanIgnoreReturnValue public final ImmutableSetLocale.Builder addTriggers(Trigger<ItemState> element)
Adds one element totriggerslist.- Parameters:
element- A triggers element- Returns:
thisbuilder for use in a chained invocation
-
addTriggers
@CanIgnoreReturnValue @SafeVarargs public final ImmutableSetLocale.Builder addTriggers(Trigger<ItemState>... elements)
Adds elements totriggerslist.- Parameters:
elements- An array of triggers elements- Returns:
thisbuilder for use in a chained invocation
-
triggers
@CanIgnoreReturnValue public final ImmutableSetLocale.Builder triggers(Iterable<? extends Trigger<ItemState>> elements)
Sets or replaces all elements fortriggerslist.- Parameters:
elements- An iterable of triggers elements- Returns:
thisbuilder for use in a chained invocation
-
addAllTriggers
@CanIgnoreReturnValue public final ImmutableSetLocale.Builder addAllTriggers(Iterable<? extends Trigger<ItemState>> elements)
Adds elements totriggerslist.- Parameters:
elements- An iterable of triggers elements- Returns:
thisbuilder for use in a chained invocation
-
targetId
@CanIgnoreReturnValue public final ImmutableSetLocale.Builder targetId(ItemId targetId)
Initializes the value for thetargetIdattribute.If not set, this attribute will have a default value as returned by the initializer of
targetId.- Parameters:
targetId- The value for targetId- Returns:
thisbuilder for use in a chained invocation
-
locale
@CanIgnoreReturnValue public final ImmutableSetLocale.Builder locale(@Nullable String locale)
Initializes the value for thelocaleattribute.- Parameters:
locale- The value for locale (can benull)- Returns:
thisbuilder for use in a chained invocation
-
build
public ImmutableSetLocale build()
Builds a newImmutableSetLocale.- Returns:
- An immutable instance of SetLocale
- Throws:
IllegalStateException- if any required attributes are missing
-
-