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 type ImmutableAction. Initialize attributes and then invoke the build() method to create an immutable instance.

Builder is not thread-safe and generally should not be stored in a field or collection, but instead used immediately to create instances.

  • Method Details

    • from

      public final ImmutableAction.Builder from(Action instance)
      Fill a builder with attribute values from the provided Action instance. 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:
      this builder for use in a chained invocation
    • type

      public final ImmutableAction.Builder type(Action.Type type)
      Initializes the value for the type attribute.
      Parameters:
      type - The value for type
      Returns:
      this builder for use in a chained invocation
    • id

      public final ImmutableAction.Builder id(String id)
      Initializes the value for the id attribute.
      Parameters:
      id - The value for id (can be null)
      Returns:
      this builder for use in a chained invocation
    • message

      public final ImmutableAction.Builder message(String message)
      Initializes the value for the message attribute.
      Parameters:
      message - The value for message (can be null)
      Returns:
      this builder for use in a chained invocation
    • trace

      public final ImmutableAction.Builder trace(String trace)
      Initializes the value for the trace attribute.
      Parameters:
      trace - The value for trace (can be null)
      Returns:
      this builder for use in a chained invocation
    • item

      public final ImmutableAction.Builder item(ActionItem item)
      Initializes the value for the item attribute.
      Parameters:
      item - The value for item (can be null)
      Returns:
      this builder for use in a chained invocation
    • error

      public final ImmutableAction.Builder error(Error error)
      Initializes the value for the error attribute.
      Parameters:
      error - The value for error (can be null)
      Returns:
      this builder for use in a chained invocation
    • answer

      public final ImmutableAction.Builder answer(Object answer)
      Initializes the value for the answer attribute.
      Parameters:
      answer - The value for answer (can be null)
      Returns:
      this builder for use in a chained invocation
    • addIds

      public final ImmutableAction.Builder addIds(String element)
      Adds one element to ids list.
      Parameters:
      element - A ids element
      Returns:
      this builder for use in a chained invocation
    • addIds

      public final ImmutableAction.Builder addIds(String... elements)
      Adds elements to ids list.
      Parameters:
      elements - An array of ids elements
      Returns:
      this builder for use in a chained invocation
    • ids

      public final ImmutableAction.Builder ids(Iterable<String> elements)
      Sets or replaces all elements for ids list.
      Parameters:
      elements - An iterable of ids elements
      Returns:
      this builder for use in a chained invocation
    • addAllIds

      public final ImmutableAction.Builder addAllIds(Iterable<String> elements)
      Adds elements to ids list.
      Parameters:
      elements - An iterable of ids elements
      Returns:
      this builder for use in a chained invocation
    • value

      public final ImmutableAction.Builder value(Object value)
      Initializes the value for the value attribute.
      Parameters:
      value - The value for value (can be null)
      Returns:
      this builder for use in a chained invocation
    • valueSet

      public final ImmutableAction.Builder valueSet(ValueSet valueSet)
      Initializes the value for the valueSet attribute.
      Parameters:
      valueSet - The value for valueSet (can be null)
      Returns:
      this builder for use in a chained invocation
    • serverEvent

      public final ImmutableAction.Builder serverEvent(Boolean serverEvent)
      Initializes the value for the serverEvent attribute.
      Parameters:
      serverEvent - The value for serverEvent (can be null)
      Returns:
      this builder for use in a chained invocation
    • resourceId

      public final ImmutableAction.Builder resourceId(String resourceId)
      Initializes the value for the resourceId attribute.
      Parameters:
      resourceId - The value for resourceId (can be null)
      Returns:
      this builder for use in a chained invocation
    • build

      public ImmutableAction build()
      Builds a new ImmutableAction.
      Returns:
      An immutable instance of Action
      Throws:
      IllegalStateException - if any required attributes are missing