Class ImmutableItemIndex
java.lang.Object
io.dialob.session.engine.session.model.ImmutableItemIndex
- All Implemented Interfaces:
ItemId,ItemIndex,Serializable
@Generated(from="ItemIndex",
generator="Immutables")
@ParametersAreNonnullByDefault
@Generated("org.immutables.processor.ProxyProcessor")
@Immutable
@CheckReturnValue
public final class ImmutableItemIndex
extends Object
implements ItemIndex
Immutable implementation of
ItemIndex.
Use the builder to create immutable instances:
ImmutableItemIndex.builder().
Use the static factory method to create immutable instances:
ImmutableItemIndex.of().
- See Also:
-
Nested Class Summary
Nested Classes -
Method Summary
Modifier and TypeMethodDescriptionstatic ImmutableItemIndex.Builderbuilder()Creates a builder forImmutableItemIndex.static ImmutableItemIndexCreates an immutable copy of aItemIndexvalue.booleanThis instance is equal to all instances ofImmutableItemIndexthat have equal attribute values.getIndex()inthashCode()Computes a hash code from attributes:parent,index.static ImmutableItemIndexConstruct a new immutableItemIndexinstance.toString()Prints the immutable valueItemIndexwith attribute values.final ImmutableItemIndexCopy the current immutable object by setting a value for theindexattribute.final ImmutableItemIndexwithParent(ItemId value) Copy the current immutable object by setting a present value for the optionalparentattribute.final ImmutableItemIndexwithParent(Optional<? extends ItemId> optional) Copy the current immutable object by setting an optional value for theparentattribute.
-
Method Details
-
getParent
-
getIndex
-
withParent
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 or
thisif not changed
-
withParent
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- An optional value for parent- Returns:
- A modified copy or
thisif not changed
-
withIndex
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 or the
thisobject
-
equals
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
Prints the immutable valueItemIndexwith attribute values. -
of
Construct a new immutableItemIndexinstance.- Parameters:
index- The value for theindexattributeparent- The value for theparentattribute- Returns:
- An immutable ItemIndex instance
-
copyOf
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
Creates a builder forImmutableItemIndex.ImmutableItemIndex.builder() .parent(Optional<io.dialob.session.engine.session.model.ItemId>) // optionalparent.index(Integer) // requiredindex.build();- Returns:
- A new ImmutableItemIndex builder
-