Package io.dialob.executor.model
Class ImmutableItemRef
- java.lang.Object
-
- io.dialob.executor.model.ImmutableItemRef
-
- All Implemented Interfaces:
ItemId,ItemRef,Serializable
@ParametersAreNonnullByDefault @Generated("org.immutables.processor.ProxyProcessor") @Immutable @CheckReturnValue public final class ImmutableItemRef extends Object implements ItemRef
Immutable implementation ofItemRef.Use the builder to create immutable instances:
ImmutableItemRef.builder(). Use the static factory method to create immutable instances:ImmutableItemRef.of().- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classImmutableItemRef.BuilderBuilds instances of typeImmutableItemRef.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static ImmutableItemRef.Builderbuilder()Creates a builder forImmutableItemRef.static ImmutableItemRefcopyOf(ItemRef instance)Creates an immutable copy of aItemRefvalue.booleanequals(Object another)This instance is equal to all instances ofImmutableItemRefthat have equal attribute values.StringgetId()Optional<ItemId>getParent()inthashCode()Computes a hash code from attributes:parent,id.static ImmutableItemRefof(String id, Optional<? extends ItemId> parent)Construct a new immutableItemRefinstance.StringtoString()Prints the immutable valueItemRefwith attribute values.ImmutableItemRefwithId(String value)Copy the current immutable object by setting a value for theidattribute.ImmutableItemRefwithParent(ItemId value)Copy the current immutable object by setting a present value for the optionalparentattribute.ImmutableItemRefwithParent(Optional<? extends ItemId> optional)Copy the current immutable object by setting an optional value for theparentattribute.
-
-
-
Method Detail
-
getId
public String getId()
-
withParent
public final ImmutableItemRef 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 ImmutableItemRef 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
-
withId
public final ImmutableItemRef withId(String value)
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 of the
thisobject
-
equals
public boolean equals(@Nullable Object another)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
public String toString()
Prints the immutable valueItemRefwith attribute values.
-
of
public static ImmutableItemRef of(String id, Optional<? extends ItemId> parent)
Construct a new immutableItemRefinstance.- Parameters:
id- The value for theidattributeparent- The value for theparentattribute- Returns:
- An immutable ItemRef instance
-
copyOf
public static ImmutableItemRef copyOf(ItemRef instance)
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
public static ImmutableItemRef.Builder builder()
Creates a builder forImmutableItemRef.ImmutableItemRef.builder() .parent(io.dialob.executor.model.ItemId) // optionalparent.id(String) // requiredid.build();- Returns:
- A new ImmutableItemRef builder
-
-