Class ImmutableScope.Builder

java.lang.Object
io.dialob.session.engine.session.model.ImmutableScope.Builder
Enclosing class:
ImmutableScope

@Generated(from="Scope", generator="Immutables") @NotThreadSafe public static final class ImmutableScope.Builder extends Object
Builds instances of type ImmutableScope. 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

      @CanIgnoreReturnValue public final ImmutableScope.Builder from(Scope instance)
      Fill a builder with attribute values from the provided Scope 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
    • scopeId

      @CanIgnoreReturnValue public final ImmutableScope.Builder scopeId(ItemId scopeId)
      Initializes the value for the scopeId attribute.
      Parameters:
      scopeId - The value for scopeId
      Returns:
      this builder for use in a chained invocation
    • addScopeItems

      @CanIgnoreReturnValue public final ImmutableScope.Builder addScopeItems(ItemId element)
      Adds one element to scopeItems set.
      Parameters:
      element - A scopeItems element
      Returns:
      this builder for use in a chained invocation
    • addScopeItems

      @CanIgnoreReturnValue public final ImmutableScope.Builder addScopeItems(ItemId... elements)
      Adds elements to scopeItems set.
      Parameters:
      elements - An array of scopeItems elements
      Returns:
      this builder for use in a chained invocation
    • scopeItems

      @CanIgnoreReturnValue public final ImmutableScope.Builder scopeItems(Iterable<? extends ItemId> elements)
      Sets or replaces all elements for scopeItems set.
      Parameters:
      elements - An iterable of scopeItems elements
      Returns:
      this builder for use in a chained invocation
    • addAllScopeItems

      @CanIgnoreReturnValue public final ImmutableScope.Builder addAllScopeItems(Iterable<? extends ItemId> elements)
      Adds elements to scopeItems set.
      Parameters:
      elements - An iterable of scopeItems elements
      Returns:
      this builder for use in a chained invocation
    • build

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