Package io.dialob.executor.model
Class ImmutableItemIndex
- java.lang.Object
-
- io.dialob.executor.model.ImmutableItemIndex
-
- All Implemented Interfaces:
ItemId,ItemIndex,Serializable
@ParametersAreNonnullByDefault @Generated("org.immutables.processor.ProxyProcessor") @Immutable @CheckReturnValue public final class ImmutableItemIndex extends Object implements ItemIndex
Immutable implementation ofItemIndex.Use the builder to create immutable instances:
ImmutableItemIndex.builder(). Use the static factory method to create immutable instances:ImmutableItemIndex.of().- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classImmutableItemIndex.BuilderBuilds instances of typeImmutableItemIndex.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static ImmutableItemIndex.Builderbuilder()Creates a builder forImmutableItemIndex.static ImmutableItemIndexcopyOf(ItemIndex instance)Creates an immutable copy of aItemIndexvalue.booleanequals(Object another)This instance is equal to all instances ofImmutableItemIndexthat have equal attribute values.IntegergetIndex()Optional<ItemId>getParent()inthashCode()Computes a hash code from attributes:parent,index.static ImmutableItemIndexof(Integer index, Optional<? extends ItemId> parent)Construct a new immutableItemIndexinstance.StringtoString()Prints the immutable valueItemIndexwith attribute values.ImmutableItemIndexwithIndex(Integer value)Copy the current immutable object by setting a value for theindexattribute.ImmutableItemIndexwithParent(ItemId value)Copy the current immutable object by setting a present value for the optionalparentattribute.ImmutableItemIndexwithParent(Optional<? extends ItemId> optional)Copy the current immutable object by setting an optional value for theparentattribute.
-
-
-
Method Detail
-
getIndex
public Integer getIndex()
-
withParent
public final ImmutableItemIndex withParent(ItemId value)
Copy the current immutable object by setting a present value for the optionalparentattribute.- Specified by:
withParentin interfaceItemId- Parameters:
value- The value for parent- Returns:
- A modified copy of
thisobject
-
withParent
public final ImmutableItemIndex withParent(Optional<? extends ItemId> optional)
Copy the current immutable object by setting an optional value for theparentattribute. A shallow reference equality check is used on unboxed optional value to prevent copying of the same value by returningthis.- Specified by:
withParentin interfaceItemId- Parameters:
optional- A value for parent- Returns:
- A modified copy of
thisobject
-
withIndex
public final ImmutableItemIndex withIndex(Integer value)
Copy the current immutable object by setting a value for theindexattribute. An equals check used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for index- Returns:
- A modified copy of the
thisobject
-
equals
public boolean equals(@Nullable Object another)This instance is equal to all instances ofImmutableItemIndexthat have equal attribute values.
-
hashCode
public int hashCode()
Computes a hash code from attributes:parent,index.
-
toString
public String toString()
Prints the immutable valueItemIndexwith attribute values.
-
of
public static ImmutableItemIndex of(Integer index, Optional<? extends ItemId> parent)
Construct a new immutableItemIndexinstance.- Parameters:
index- The value for theindexattributeparent- The value for theparentattribute- Returns:
- An immutable ItemIndex instance
-
copyOf
public static ImmutableItemIndex copyOf(ItemIndex instance)
Creates an immutable copy of aItemIndexvalue. 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 ItemIndex instance
-
builder
public static ImmutableItemIndex.Builder builder()
Creates a builder forImmutableItemIndex.ImmutableItemIndex.builder() .parent(io.dialob.executor.model.ItemId) // optionalparent.index(Integer) // requiredindex.build();- Returns:
- A new ImmutableItemIndex builder
-
-