Class ImmutableActions.Builder

java.lang.Object
io.dialob.api.proto.ImmutableActions.Builder
Enclosing class:
ImmutableActions

@NotThreadSafe public static final class ImmutableActions.Builder extends Object
Builds instances of type ImmutableActions. 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 ImmutableActions.Builder from(Actions instance)
      Fill a builder with attribute values from the provided Actions 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
    • rev

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

      public final ImmutableActions.Builder addActions(Action element)
      Adds one element to actions list.
      Parameters:
      element - A actions element
      Returns:
      this builder for use in a chained invocation
    • addActions

      public final ImmutableActions.Builder addActions(Action... elements)
      Adds elements to actions list.
      Parameters:
      elements - An array of actions elements
      Returns:
      this builder for use in a chained invocation
    • actions

      public final ImmutableActions.Builder actions(Iterable<? extends Action> elements)
      Sets or replaces all elements for actions list.
      Parameters:
      elements - An iterable of actions elements
      Returns:
      this builder for use in a chained invocation
    • addAllActions

      public final ImmutableActions.Builder addAllActions(Iterable<? extends Action> elements)
      Adds elements to actions list.
      Parameters:
      elements - An iterable of actions elements
      Returns:
      this builder for use in a chained invocation
    • build

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