Class ImmutableAction

  • All Implemented Interfaces:
    Action, Serializable

    @ParametersAreNonnullByDefault
    @Generated("org.immutables.processor.ProxyProcessor")
    @Immutable
    public final class ImmutableAction
    extends Object
    implements Action
    Immutable implementation of Action.

    Use the builder to create immutable instances: ImmutableAction.builder().

    See Also:
    Serialized Form
    • Method Detail

      • getType

        public Action.Type getType()
        Specified by:
        getType in interface Action
        Returns:
        The value of the type attribute
      • getId

        public String getId()
        Specified by:
        getId in interface Action
        Returns:
        The value of the id attribute
      • getMessage

        public String getMessage()
        Specified by:
        getMessage in interface Action
        Returns:
        The value of the message attribute
      • getTrace

        public String getTrace()
        Specified by:
        getTrace in interface Action
        Returns:
        The value of the trace attribute
      • getItem

        public ActionItem getItem()
        Specified by:
        getItem in interface Action
        Returns:
        The value of the item attribute
      • getError

        public Error getError()
        Specified by:
        getError in interface Action
        Returns:
        The value of the error attribute
      • getAnswer

        public Object getAnswer()
        Specified by:
        getAnswer in interface Action
        Returns:
        The value of the answer attribute
      • getIds

        public List<String> getIds()
        Specified by:
        getIds in interface Action
        Returns:
        The value of the ids attribute
      • getValue

        public Object getValue()
        Specified by:
        getValue in interface Action
        Returns:
        The value of the value attribute
      • getValueSet

        public ValueSet getValueSet()
        Specified by:
        getValueSet in interface Action
        Returns:
        The value of the valueSet attribute
      • getServerEvent

        public Boolean getServerEvent()
        Specified by:
        getServerEvent in interface Action
        Returns:
        The value of the serverEvent attribute
      • getResourceId

        public String getResourceId()
        Specified by:
        getResourceId in interface Action
        Returns:
        The value of the resourceId attribute
      • withType

        public final ImmutableAction withType​(Action.Type value)
        Copy the current immutable object by setting a value for the type attribute. A value equality check is used to prevent copying of the same value by returning this.
        Parameters:
        value - A new value for type
        Returns:
        A modified copy of the this object
      • withId

        public final ImmutableAction withId​(String value)
        Copy the current immutable object by setting a value for the id attribute. An equals check used to prevent copying of the same value by returning this.
        Parameters:
        value - A new value for id (can be null)
        Returns:
        A modified copy of the this object
      • withMessage

        public final ImmutableAction withMessage​(String value)
        Copy the current immutable object by setting a value for the message attribute. An equals check used to prevent copying of the same value by returning this.
        Parameters:
        value - A new value for message (can be null)
        Returns:
        A modified copy of the this object
      • withTrace

        public final ImmutableAction withTrace​(String value)
        Copy the current immutable object by setting a value for the trace attribute. An equals check used to prevent copying of the same value by returning this.
        Parameters:
        value - A new value for trace (can be null)
        Returns:
        A modified copy of the this object
      • withItem

        public final ImmutableAction withItem​(ActionItem value)
        Copy the current immutable object by setting a value for the item attribute. A shallow reference equality check is used to prevent copying of the same value by returning this.
        Parameters:
        value - A new value for item (can be null)
        Returns:
        A modified copy of the this object
      • withError

        public final ImmutableAction withError​(Error value)
        Copy the current immutable object by setting a value for the error attribute. A shallow reference equality check is used to prevent copying of the same value by returning this.
        Parameters:
        value - A new value for error (can be null)
        Returns:
        A modified copy of the this object
      • withAnswer

        public final ImmutableAction withAnswer​(Object value)
        Copy the current immutable object by setting a value for the answer attribute. A shallow reference equality check is used to prevent copying of the same value by returning this.
        Parameters:
        value - A new value for answer (can be null)
        Returns:
        A modified copy of the this object
      • withIds

        public final ImmutableAction withIds​(String... elements)
        Copy the current immutable object with elements that replace the content of ids.
        Parameters:
        elements - The elements to set
        Returns:
        A modified copy of this object
      • withIds

        public final ImmutableAction withIds​(Iterable<String> elements)
        Copy the current immutable object with elements that replace the content of ids. A shallow reference equality check is used to prevent copying of the same value by returning this.
        Parameters:
        elements - An iterable of ids elements to set
        Returns:
        A modified copy of this object
      • withValue

        public final ImmutableAction withValue​(Object value)
        Copy the current immutable object by setting a value for the value attribute. A shallow reference equality check is used to prevent copying of the same value by returning this.
        Parameters:
        value - A new value for value (can be null)
        Returns:
        A modified copy of the this object
      • withValueSet

        public final ImmutableAction withValueSet​(ValueSet value)
        Copy the current immutable object by setting a value for the valueSet attribute. A shallow reference equality check is used to prevent copying of the same value by returning this.
        Parameters:
        value - A new value for valueSet (can be null)
        Returns:
        A modified copy of the this object
      • withServerEvent

        public final ImmutableAction withServerEvent​(Boolean value)
        Copy the current immutable object by setting a value for the serverEvent attribute. An equals check used to prevent copying of the same value by returning this.
        Parameters:
        value - A new value for serverEvent (can be null)
        Returns:
        A modified copy of the this object
      • withResourceId

        public final ImmutableAction withResourceId​(String value)
        Copy the current immutable object by setting a value for the resourceId attribute. An equals check used to prevent copying of the same value by returning this.
        Parameters:
        value - A new value for resourceId (can be null)
        Returns:
        A modified copy of the this object
      • equals

        public boolean equals​(@Nullable
                              Object another)
        This instance is equal to all instances of ImmutableAction that have equal attribute values.
        Overrides:
        equals in class Object
        Returns:
        true if this is equal to another instance
      • hashCode

        public int hashCode()
        Computes a hash code from attributes: type, id, message, trace, item, error, answer, ids, value, valueSet, serverEvent, resourceId.
        Overrides:
        hashCode in class Object
        Returns:
        hashCode value
      • toString

        public String toString()
        Prints the immutable value Action with attribute values.
        Overrides:
        toString in class Object
        Returns:
        A string representation of the value
      • copyOf

        public static ImmutableAction copyOf​(Action instance)
        Creates an immutable copy of a Action value. 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 for ImmutableAction.
         ImmutableAction.builder()
            .type(io.dialob.api.proto.Action.Type) // required type
            .id(String | null) // nullable id
            .message(String | null) // nullable message
            .trace(String | null) // nullable trace
            .item(io.dialob.api.proto.ActionItem | null) // nullable item
            .error(io.dialob.api.questionnaire.Error | null) // nullable error
            .answer(Object | null) // nullable answer
            .ids(List&lt;String&gt; | null) // nullable ids
            .value(Object | null) // nullable value
            .valueSet(io.dialob.api.proto.ValueSet | null) // nullable valueSet
            .serverEvent(Boolean | null) // nullable serverEvent
            .resourceId(String | null) // nullable resourceId
            .build();
         
        Returns:
        A new ImmutableAction builder