Package io.dialob.executor.model
Class ImmutableScope
- java.lang.Object
-
- io.dialob.executor.model.ImmutableScope
-
- All Implemented Interfaces:
Scope,Serializable
@ParametersAreNonnullByDefault @Generated("org.immutables.processor.ProxyProcessor") @Immutable @CheckReturnValue public final class ImmutableScope extends Object implements Scope
Immutable implementation ofScope.Use the builder to create immutable instances:
ImmutableScope.builder(). Use the static factory method to create immutable instances:ImmutableScope.of().- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classImmutableScope.BuilderBuilds instances of typeImmutableScope.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static ImmutableScope.Builderbuilder()Creates a builder forImmutableScope.static ImmutableScopecopyOf(Scope instance)Creates an immutable copy of aScopevalue.booleanequals(Object another)This instance is equal to all instances ofImmutableScopethat have equal attribute values.ItemIdgetScopeId()com.google.common.collect.ImmutableSet<ItemId>getScopeItems()inthashCode()Computes a hash code from attributes:scopeId,scopeItems.static ImmutableScopeof(ItemId scopeId, Iterable<? extends ItemId> scopeItems)Construct a new immutableScopeinstance.static ImmutableScopeof(ItemId scopeId, Set<ItemId> scopeItems)Construct a new immutableScopeinstance.StringtoString()Prints the immutable valueScopewith attribute values.ImmutableScopewithScopeId(ItemId value)Copy the current immutable object by setting a value for thescopeIdattribute.ImmutableScopewithScopeItems(ItemId... elements)Copy the current immutable object with elements that replace the content ofscopeItems.ImmutableScopewithScopeItems(Iterable<? extends ItemId> elements)Copy the current immutable object with elements that replace the content ofscopeItems.
-
-
-
Method Detail
-
getScopeId
public ItemId getScopeId()
- Specified by:
getScopeIdin interfaceScope- Returns:
- The value of the
scopeIdattribute
-
getScopeItems
public com.google.common.collect.ImmutableSet<ItemId> getScopeItems()
- Specified by:
getScopeItemsin interfaceScope- Returns:
- The value of the
scopeItemsattribute
-
withScopeId
public final ImmutableScope withScopeId(ItemId value)
Copy the current immutable object by setting a value for thescopeIdattribute. A shallow reference equality check is used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for scopeId- Returns:
- A modified copy of the
thisobject
-
withScopeItems
public final ImmutableScope withScopeItems(ItemId... elements)
Copy the current immutable object with elements that replace the content ofscopeItems.- Parameters:
elements- The elements to set- Returns:
- A modified copy of
thisobject
-
withScopeItems
public final ImmutableScope withScopeItems(Iterable<? extends ItemId> elements)
Copy the current immutable object with elements that replace the content ofscopeItems. A shallow reference equality check is used to prevent copying of the same value by returningthis.- Parameters:
elements- An iterable of scopeItems elements to set- Returns:
- A modified copy of
thisobject
-
equals
public boolean equals(@Nullable Object another)This instance is equal to all instances ofImmutableScopethat have equal attribute values.
-
hashCode
public int hashCode()
Computes a hash code from attributes:scopeId,scopeItems.
-
toString
public String toString()
Prints the immutable valueScopewith attribute values.
-
of
public static ImmutableScope of(ItemId scopeId, Set<ItemId> scopeItems)
Construct a new immutableScopeinstance.- Parameters:
scopeId- The value for thescopeIdattributescopeItems- The value for thescopeItemsattribute- Returns:
- An immutable Scope instance
-
of
public static ImmutableScope of(ItemId scopeId, Iterable<? extends ItemId> scopeItems)
Construct a new immutableScopeinstance.- Parameters:
scopeId- The value for thescopeIdattributescopeItems- The value for thescopeItemsattribute- Returns:
- An immutable Scope instance
-
copyOf
public static ImmutableScope copyOf(Scope instance)
Creates an immutable copy of aScopevalue. 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 Scope instance
-
builder
public static ImmutableScope.Builder builder()
Creates a builder forImmutableScope.ImmutableScope.builder() .scopeId(io.dialob.executor.model.ItemId) // requiredscopeId.addScopeItems|addAllScopeItems(io.dialob.executor.model.ItemId) //scopeItemselements .build();- Returns:
- A new ImmutableScope builder
-
-