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 Summary
Modifier and TypeMethodDescriptionfinal ImmutableScope.BuilderaddAllScopeItems(Iterable<? extends ItemId> elements) Adds elements toscopeItemsset.final ImmutableScope.BuilderaddScopeItems(ItemId element) Adds one element toscopeItemsset.final ImmutableScope.BuilderaddScopeItems(ItemId... elements) Adds elements toscopeItemsset.build()Builds a newImmutableScope.final ImmutableScope.BuilderFill a builder with attribute values from the providedScopeinstance.final ImmutableScope.BuilderInitializes the value for thescopeIdattribute.final ImmutableScope.BuilderscopeItems(Iterable<? extends ItemId> elements) Sets or replaces all elements forscopeItemsset.
-
Method Details
-
from
Fill a builder with attribute values from the providedScopeinstance. 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:
thisbuilder for use in a chained invocation
-
scopeId
Initializes the value for thescopeIdattribute.- Parameters:
scopeId- The value for scopeId- Returns:
thisbuilder for use in a chained invocation
-
addScopeItems
Adds one element toscopeItemsset.- Parameters:
element- A scopeItems element- Returns:
thisbuilder for use in a chained invocation
-
addScopeItems
Adds elements toscopeItemsset.- Parameters:
elements- An array of scopeItems elements- Returns:
thisbuilder for use in a chained invocation
-
scopeItems
@CanIgnoreReturnValue public final ImmutableScope.Builder scopeItems(Iterable<? extends ItemId> elements) Sets or replaces all elements forscopeItemsset.- Parameters:
elements- An iterable of scopeItems elements- Returns:
thisbuilder for use in a chained invocation
-
addAllScopeItems
@CanIgnoreReturnValue public final ImmutableScope.Builder addAllScopeItems(Iterable<? extends ItemId> elements) Adds elements toscopeItemsset.- Parameters:
elements- An iterable of scopeItems elements- Returns:
thisbuilder for use in a chained invocation
-
build
Builds a newImmutableScope.- Returns:
- An immutable instance of Scope
- Throws:
IllegalStateException- if any required attributes are missing
-