Package io.dialob.api.proto
Class ImmutableAction
- java.lang.Object
-
- io.dialob.api.proto.ImmutableAction
-
- All Implemented Interfaces:
Action,Serializable
@ParametersAreNonnullByDefault @Generated("org.immutables.processor.ProxyProcessor") @Immutable public final class ImmutableAction extends Object implements Action
Immutable implementation ofAction.Use the builder to create immutable instances:
ImmutableAction.builder().- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classImmutableAction.BuilderBuilds instances of typeImmutableAction.-
Nested classes/interfaces inherited from interface io.dialob.api.proto.Action
Action.Type
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static ImmutableAction.Builderbuilder()Creates a builder forImmutableAction.static ImmutableActioncopyOf(Action instance)Creates an immutable copy of aActionvalue.booleanequals(Object another)This instance is equal to all instances ofImmutableActionthat have equal attribute values.ObjectgetAnswer()ErrorgetError()StringgetId()List<String>getIds()ActionItemgetItem()StringgetMessage()StringgetResourceId()BooleangetServerEvent()StringgetTrace()Action.TypegetType()ObjectgetValue()ValueSetgetValueSet()inthashCode()Computes a hash code from attributes:type,id,message,trace,item,error,answer,ids,value,valueSet,serverEvent,resourceId.StringtoString()Prints the immutable valueActionwith attribute values.ImmutableActionwithAnswer(Object value)Copy the current immutable object by setting a value for theanswerattribute.ImmutableActionwithError(Error value)Copy the current immutable object by setting a value for theerrorattribute.ImmutableActionwithId(String value)Copy the current immutable object by setting a value for theidattribute.ImmutableActionwithIds(Iterable<String> elements)Copy the current immutable object with elements that replace the content ofids.ImmutableActionwithIds(String... elements)Copy the current immutable object with elements that replace the content ofids.ImmutableActionwithItem(ActionItem value)Copy the current immutable object by setting a value for theitemattribute.ImmutableActionwithMessage(String value)Copy the current immutable object by setting a value for themessageattribute.ImmutableActionwithResourceId(String value)Copy the current immutable object by setting a value for theresourceIdattribute.ImmutableActionwithServerEvent(Boolean value)Copy the current immutable object by setting a value for theserverEventattribute.ImmutableActionwithTrace(String value)Copy the current immutable object by setting a value for thetraceattribute.ImmutableActionwithType(Action.Type value)Copy the current immutable object by setting a value for thetypeattribute.ImmutableActionwithValue(Object value)Copy the current immutable object by setting a value for thevalueattribute.ImmutableActionwithValueSet(ValueSet value)Copy the current immutable object by setting a value for thevalueSetattribute.
-
-
-
Method Detail
-
getType
public Action.Type getType()
-
getId
public String getId()
-
getMessage
public String getMessage()
- Specified by:
getMessagein interfaceAction- Returns:
- The value of the
messageattribute
-
getTrace
public String getTrace()
-
getItem
public ActionItem getItem()
-
getError
public Error getError()
-
getAnswer
public Object getAnswer()
-
getValue
public Object getValue()
-
getValueSet
public ValueSet getValueSet()
- Specified by:
getValueSetin interfaceAction- Returns:
- The value of the
valueSetattribute
-
getServerEvent
public Boolean getServerEvent()
- Specified by:
getServerEventin interfaceAction- Returns:
- The value of the
serverEventattribute
-
getResourceId
public String getResourceId()
- Specified by:
getResourceIdin interfaceAction- Returns:
- The value of the
resourceIdattribute
-
withType
public final ImmutableAction withType(Action.Type value)
Copy the current immutable object by setting a value for thetypeattribute. A value equality check is used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for type- Returns:
- A modified copy of the
thisobject
-
withId
public final ImmutableAction withId(String value)
Copy the current immutable object by setting a value for theidattribute. An equals check used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for id (can benull)- Returns:
- A modified copy of the
thisobject
-
withMessage
public final ImmutableAction withMessage(String value)
Copy the current immutable object by setting a value for themessageattribute. An equals check used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for message (can benull)- Returns:
- A modified copy of the
thisobject
-
withTrace
public final ImmutableAction withTrace(String value)
Copy the current immutable object by setting a value for thetraceattribute. An equals check used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for trace (can benull)- Returns:
- A modified copy of the
thisobject
-
withItem
public final ImmutableAction withItem(ActionItem value)
Copy the current immutable object by setting a value for theitemattribute. A shallow reference equality check is used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for item (can benull)- Returns:
- A modified copy of the
thisobject
-
withError
public final ImmutableAction withError(Error value)
Copy the current immutable object by setting a value for theerrorattribute. A shallow reference equality check is used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for error (can benull)- Returns:
- A modified copy of the
thisobject
-
withAnswer
public final ImmutableAction withAnswer(Object value)
Copy the current immutable object by setting a value for theanswerattribute. A shallow reference equality check is used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for answer (can benull)- Returns:
- A modified copy of the
thisobject
-
withIds
public final ImmutableAction withIds(String... elements)
Copy the current immutable object with elements that replace the content ofids.- Parameters:
elements- The elements to set- Returns:
- A modified copy of
thisobject
-
withIds
public final ImmutableAction withIds(Iterable<String> elements)
Copy the current immutable object with elements that replace the content ofids. A shallow reference equality check is used to prevent copying of the same value by returningthis.- Parameters:
elements- An iterable of ids elements to set- Returns:
- A modified copy of
thisobject
-
withValue
public final ImmutableAction withValue(Object value)
Copy the current immutable object by setting a value for thevalueattribute. A shallow reference equality check is used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for value (can benull)- Returns:
- A modified copy of the
thisobject
-
withValueSet
public final ImmutableAction withValueSet(ValueSet value)
Copy the current immutable object by setting a value for thevalueSetattribute. A shallow reference equality check is used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for valueSet (can benull)- Returns:
- A modified copy of the
thisobject
-
withServerEvent
public final ImmutableAction withServerEvent(Boolean value)
Copy the current immutable object by setting a value for theserverEventattribute. An equals check used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for serverEvent (can benull)- Returns:
- A modified copy of the
thisobject
-
withResourceId
public final ImmutableAction withResourceId(String value)
Copy the current immutable object by setting a value for theresourceIdattribute. An equals check used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for resourceId (can benull)- Returns:
- A modified copy of the
thisobject
-
equals
public boolean equals(@Nullable Object another)This instance is equal to all instances ofImmutableActionthat have equal attribute values.
-
hashCode
public int hashCode()
Computes a hash code from attributes:type,id,message,trace,item,error,answer,ids,value,valueSet,serverEvent,resourceId.
-
toString
public String toString()
Prints the immutable valueActionwith attribute values.
-
copyOf
public static ImmutableAction copyOf(Action instance)
Creates an immutable copy of aActionvalue. Uses accessors to get values to initialize the new immutable instance. If an instance is already immutable, it is returned as is.- Parameters:
instance- The instance to copy- Returns:
- A copied immutable Action instance
-
builder
public static ImmutableAction.Builder builder()
Creates a builder forImmutableAction.ImmutableAction.builder() .type(io.dialob.api.proto.Action.Type) // requiredtype.id(String | null) // nullableid.message(String | null) // nullablemessage.trace(String | null) // nullabletrace.item(io.dialob.api.proto.ActionItem | null) // nullableitem.error(io.dialob.api.questionnaire.Error | null) // nullableerror.answer(Object | null) // nullableanswer.ids(List<String> | null) // nullableids.value(Object | null) // nullablevalue.valueSet(io.dialob.api.proto.ValueSet | null) // nullablevalueSet.serverEvent(Boolean | null) // nullableserverEvent.resourceId(String | null) // nullableresourceId.build();- Returns:
- A new ImmutableAction builder
-
-