Class ImmutableItemRef
java.lang.Object
io.dialob.session.engine.session.model.ImmutableItemRef
- All Implemented Interfaces:
ItemId,ItemRef,Serializable
@Generated(from="ItemRef",
generator="Immutables")
@ParametersAreNonnullByDefault
@Generated("org.immutables.processor.ProxyProcessor")
@Immutable
@CheckReturnValue
public final class ImmutableItemRef
extends Object
implements ItemRef
Immutable implementation of
ItemRef.
Use the builder to create immutable instances:
ImmutableItemRef.builder().
Use the static factory method to create immutable instances:
ImmutableItemRef.of().
- See Also:
-
Nested Class Summary
Nested Classes -
Method Summary
Modifier and TypeMethodDescriptionstatic ImmutableItemRef.Builderbuilder()Creates a builder forImmutableItemRef.static ImmutableItemRefCreates an immutable copy of aItemRefvalue.booleanThis instance is equal to all instances ofImmutableItemRefthat have equal attribute values.getId()inthashCode()Computes a hash code from attributes:parent,id.static ImmutableItemRefConstruct a new immutableItemRefinstance.toString()Prints the immutable valueItemRefwith attribute values.final ImmutableItemRefCopy the current immutable object by setting a value for theidattribute.final ImmutableItemRefwithParent(ItemId value) Copy the current immutable object by setting a present value for the optionalparentattribute.final ImmutableItemRefwithParent(Optional<? extends ItemId> optional) Copy the current immutable object by setting an optional value for theparentattribute.
-
Method Details
-
getParent
-
getId
-
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
-
withId
Copy the current immutable object by setting a value for theidattribute. An equals check used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for id- Returns:
- A modified copy or the
thisobject
-
equals
This instance is equal to all instances ofImmutableItemRefthat have equal attribute values. -
hashCode
public int hashCode()Computes a hash code from attributes:parent,id. -
toString
Prints the immutable valueItemRefwith attribute values. -
of
Construct a new immutableItemRefinstance.- Parameters:
id- The value for theidattributeparent- The value for theparentattribute- Returns:
- An immutable ItemRef instance
-
copyOf
Creates an immutable copy of aItemRefvalue. 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 ItemRef instance
-
builder
Creates a builder forImmutableItemRef.ImmutableItemRef.builder() .parent(Optional<io.dialob.session.engine.session.model.ItemId>) // optionalparent.id(String) // requiredid.build();- Returns:
- A new ImmutableItemRef builder
-