Package io.dialob.api.proto
Class ImmutableAction.Builder
- java.lang.Object
-
- io.dialob.api.proto.ImmutableAction.Builder
-
- Enclosing class:
- ImmutableAction
@NotThreadSafe public static final class ImmutableAction.Builder extends Object
Builds instances of typeImmutableAction. 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 ImmutableAction.BuilderaddAllIds(Iterable<String> elements)Adds elements toidslist.ImmutableAction.BuilderaddIds(String element)Adds one element toidslist.ImmutableAction.BuilderaddIds(String... elements)Adds elements toidslist.ImmutableAction.Builderanswer(Object answer)Initializes the value for theanswerattribute.ImmutableActionbuild()Builds a newImmutableAction.ImmutableAction.Buildererror(Error error)Initializes the value for theerrorattribute.ImmutableAction.Builderfrom(Action instance)Fill a builder with attribute values from the providedActioninstance.ImmutableAction.Builderid(String id)Initializes the value for theidattribute.ImmutableAction.Builderids(Iterable<String> elements)Sets or replaces all elements foridslist.ImmutableAction.Builderitem(ActionItem item)Initializes the value for theitemattribute.ImmutableAction.Buildermessage(String message)Initializes the value for themessageattribute.ImmutableAction.BuilderresourceId(String resourceId)Initializes the value for theresourceIdattribute.ImmutableAction.BuilderserverEvent(Boolean serverEvent)Initializes the value for theserverEventattribute.ImmutableAction.Buildertrace(String trace)Initializes the value for thetraceattribute.ImmutableAction.Buildertype(Action.Type type)Initializes the value for thetypeattribute.ImmutableAction.Buildervalue(Object value)Initializes the value for thevalueattribute.ImmutableAction.BuildervalueSet(ValueSet valueSet)Initializes the value for thevalueSetattribute.
-
-
-
Method Detail
-
from
public final ImmutableAction.Builder from(Action instance)
Fill a builder with attribute values from the providedActioninstance. 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
public final ImmutableAction.Builder type(Action.Type type)
Initializes the value for thetypeattribute.- Parameters:
type- The value for type- Returns:
thisbuilder for use in a chained invocation
-
id
public final ImmutableAction.Builder id(String id)
Initializes the value for theidattribute.- Parameters:
id- The value for id (can benull)- Returns:
thisbuilder for use in a chained invocation
-
message
public final ImmutableAction.Builder message(String message)
Initializes the value for themessageattribute.- Parameters:
message- The value for message (can benull)- Returns:
thisbuilder for use in a chained invocation
-
trace
public final ImmutableAction.Builder trace(String trace)
Initializes the value for thetraceattribute.- Parameters:
trace- The value for trace (can benull)- Returns:
thisbuilder for use in a chained invocation
-
item
public final ImmutableAction.Builder item(ActionItem item)
Initializes the value for theitemattribute.- Parameters:
item- The value for item (can benull)- Returns:
thisbuilder for use in a chained invocation
-
error
public final ImmutableAction.Builder error(Error error)
Initializes the value for theerrorattribute.- Parameters:
error- The value for error (can benull)- Returns:
thisbuilder for use in a chained invocation
-
answer
public final ImmutableAction.Builder answer(Object answer)
Initializes the value for theanswerattribute.- Parameters:
answer- The value for answer (can benull)- Returns:
thisbuilder for use in a chained invocation
-
addIds
public final ImmutableAction.Builder addIds(String element)
Adds one element toidslist.- Parameters:
element- A ids element- Returns:
thisbuilder for use in a chained invocation
-
addIds
public final ImmutableAction.Builder addIds(String... elements)
Adds elements toidslist.- Parameters:
elements- An array of ids elements- Returns:
thisbuilder for use in a chained invocation
-
ids
public final ImmutableAction.Builder ids(Iterable<String> elements)
Sets or replaces all elements foridslist.- Parameters:
elements- An iterable of ids elements- Returns:
thisbuilder for use in a chained invocation
-
addAllIds
public final ImmutableAction.Builder addAllIds(Iterable<String> elements)
Adds elements toidslist.- Parameters:
elements- An iterable of ids elements- Returns:
thisbuilder for use in a chained invocation
-
value
public final ImmutableAction.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
-
valueSet
public final ImmutableAction.Builder valueSet(ValueSet valueSet)
Initializes the value for thevalueSetattribute.- Parameters:
valueSet- The value for valueSet (can benull)- Returns:
thisbuilder for use in a chained invocation
-
serverEvent
public final ImmutableAction.Builder serverEvent(Boolean serverEvent)
Initializes the value for theserverEventattribute.- Parameters:
serverEvent- The value for serverEvent (can benull)- Returns:
thisbuilder for use in a chained invocation
-
resourceId
public final ImmutableAction.Builder resourceId(String resourceId)
Initializes the value for theresourceIdattribute.- Parameters:
resourceId- The value for resourceId (can benull)- Returns:
thisbuilder for use in a chained invocation
-
build
public ImmutableAction build()
Builds a newImmutableAction.- Returns:
- An immutable instance of Action
- Throws:
IllegalStateException- if any required attributes are missing
-
-