Package io.dialob.api.proto
Class ImmutableActionItem.Builder
- java.lang.Object
-
- io.dialob.api.proto.ImmutableActionItem.Builder
-
- Enclosing class:
- ImmutableActionItem
@NotThreadSafe public static final class ImmutableActionItem.Builder extends Object
Builds instances of typeImmutableActionItem. 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
-
-
-
Method Detail
-
from
public final ImmutableActionItem.Builder from(ActionItem instance)
Fill a builder with attribute values from the providedActionIteminstance. 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
public final ImmutableActionItem.Builder id(String id)
Initializes the value for theidattribute.- Parameters:
id- The value for id- Returns:
thisbuilder for use in a chained invocation
-
type
public final ImmutableActionItem.Builder type(String type)
Initializes the value for thetypeattribute.- Parameters:
type- The value for type- Returns:
thisbuilder for use in a chained invocation
-
view
public final ImmutableActionItem.Builder view(String view)
Initializes the value for theviewattribute.- Parameters:
view- The value for view (can benull)- Returns:
thisbuilder for use in a chained invocation
-
label
public final ImmutableActionItem.Builder label(String label)
Initializes the value for thelabelattribute.- Parameters:
label- The value for label (can benull)- Returns:
thisbuilder for use in a chained invocation
-
description
public final ImmutableActionItem.Builder description(String description)
Initializes the value for thedescriptionattribute.- Parameters:
description- The value for description (can benull)- Returns:
thisbuilder for use in a chained invocation
-
inactive
public final ImmutableActionItem.Builder inactive(Boolean inactive)
Initializes the value for theinactiveattribute.- Parameters:
inactive- The value for inactive (can benull)- Returns:
thisbuilder for use in a chained invocation
-
disabled
public final ImmutableActionItem.Builder disabled(Boolean disabled)
Initializes the value for thedisabledattribute.- Parameters:
disabled- The value for disabled (can benull)- Returns:
thisbuilder for use in a chained invocation
-
required
public final ImmutableActionItem.Builder required(Boolean required)
Initializes the value for therequiredattribute.- Parameters:
required- The value for required (can benull)- Returns:
thisbuilder for use in a chained invocation
-
addClassName
public final ImmutableActionItem.Builder addClassName(String element)
Adds one element toclassNamelist.- Parameters:
element- A className element- Returns:
thisbuilder for use in a chained invocation
-
addClassName
public final ImmutableActionItem.Builder addClassName(String... elements)
Adds elements toclassNamelist.- Parameters:
elements- An array of className elements- Returns:
thisbuilder for use in a chained invocation
-
className
public final ImmutableActionItem.Builder className(Iterable<String> elements)
Sets or replaces all elements forclassNamelist.- Parameters:
elements- An iterable of className elements- Returns:
thisbuilder for use in a chained invocation
-
addAllClassName
public final ImmutableActionItem.Builder addAllClassName(Iterable<String> elements)
Adds elements toclassNamelist.- Parameters:
elements- An iterable of className elements- Returns:
thisbuilder for use in a chained invocation
-
value
public final ImmutableActionItem.Builder value(Object value)
Initializes the value for thevalueattribute.- Parameters:
value- The value for value (can benull)- Returns:
thisbuilder for use in a chained invocation
-
addItems
public final ImmutableActionItem.Builder addItems(String element)
Adds one element toitemslist.- Parameters:
element- A items element- Returns:
thisbuilder for use in a chained invocation
-
addItems
public final ImmutableActionItem.Builder addItems(String... elements)
Adds elements toitemslist.- Parameters:
elements- An array of items elements- Returns:
thisbuilder for use in a chained invocation
-
items
public final ImmutableActionItem.Builder items(Iterable<String> elements)
Sets or replaces all elements foritemslist.- Parameters:
elements- An iterable of items elements- Returns:
thisbuilder for use in a chained invocation
-
addAllItems
public final ImmutableActionItem.Builder addAllItems(Iterable<String> elements)
Adds elements toitemslist.- Parameters:
elements- An iterable of items elements- Returns:
thisbuilder for use in a chained invocation
-
activeItem
public final ImmutableActionItem.Builder activeItem(String activeItem)
Initializes the value for theactiveItemattribute.- Parameters:
activeItem- The value for activeItem (can benull)- Returns:
thisbuilder for use in a chained invocation
-
addAvailableItems
public final ImmutableActionItem.Builder addAvailableItems(String element)
Adds one element toavailableItemslist.- Parameters:
element- A availableItems element- Returns:
thisbuilder for use in a chained invocation
-
addAvailableItems
public final ImmutableActionItem.Builder addAvailableItems(String... elements)
Adds elements toavailableItemslist.- Parameters:
elements- An array of availableItems elements- Returns:
thisbuilder for use in a chained invocation
-
availableItems
public final ImmutableActionItem.Builder availableItems(Iterable<String> elements)
Sets or replaces all elements foravailableItemslist.- Parameters:
elements- An iterable of availableItems elements- Returns:
thisbuilder for use in a chained invocation
-
addAllAvailableItems
public final ImmutableActionItem.Builder addAllAvailableItems(Iterable<String> elements)
Adds elements toavailableItemslist.- Parameters:
elements- An iterable of availableItems elements- Returns:
thisbuilder for use in a chained invocation
-
addAllowedActions
public final ImmutableActionItem.Builder addAllowedActions(Action.Type element)
Adds one element toallowedActionsset.- Parameters:
element- A allowedActions element- Returns:
thisbuilder for use in a chained invocation
-
addAllowedActions
public final ImmutableActionItem.Builder addAllowedActions(Action.Type... elements)
Adds elements toallowedActionsset.- Parameters:
elements- An array of allowedActions elements- Returns:
thisbuilder for use in a chained invocation
-
allowedActions
public final ImmutableActionItem.Builder allowedActions(Iterable<Action.Type> elements)
Sets or replaces all elements forallowedActionsset.- Parameters:
elements- An iterable of allowedActions elements- Returns:
thisbuilder for use in a chained invocation
-
addAllAllowedActions
public final ImmutableActionItem.Builder addAllAllowedActions(Iterable<Action.Type> elements)
Adds elements toallowedActionsset.- Parameters:
elements- An iterable of allowedActions elements- Returns:
thisbuilder for use in a chained invocation
-
answered
public final ImmutableActionItem.Builder answered(Boolean answered)
Initializes the value for theansweredattribute.- Parameters:
answered- The value for answered (can benull)- Returns:
thisbuilder for use in a chained invocation
-
valueSetId
public final ImmutableActionItem.Builder valueSetId(String valueSetId)
Initializes the value for thevalueSetIdattribute.- Parameters:
valueSetId- The value for valueSetId (can benull)- Returns:
thisbuilder for use in a chained invocation
-
putProps
public final ImmutableActionItem.Builder putProps(@Nullable String key, @Nullable Object value)
Put one entry to thepropsmap.- Parameters:
key- The key in the props mapvalue- The associated value in the props map- Returns:
thisbuilder for use in a chained invocation
-
putProps
public final ImmutableActionItem.Builder putProps(Map.Entry<String,? extends Object> entry)
Put one entry to thepropsmap. Nulls are not permitted- Parameters:
entry- The key and value entry- Returns:
thisbuilder for use in a chained invocation
-
props
public final ImmutableActionItem.Builder props(Map<String,? extends Object> entries)
Sets or replaces all mappings from the specified map as entries for thepropsmap. Nulls are not permitted as keys or values, but parameter itself can be null- Parameters:
entries- The entries that will be added to the props map- Returns:
thisbuilder for use in a chained invocation
-
putAllProps
public final ImmutableActionItem.Builder putAllProps(Map<String,? extends Object> entries)
Put all mappings from the specified map as entries topropsmap. Nulls are not permitted- Parameters:
entries- The entries that will be added to the props map- Returns:
thisbuilder for use in a chained invocation
-
build
public ImmutableActionItem build()
Builds a newImmutableActionItem.- Returns:
- An immutable instance of ActionItem
- Throws:
IllegalStateException- if any required attributes are missing
-
-