@ParametersAreNonnullByDefault @Generated(value="org.immutables.processor.ProxyProcessor") @Immutable @CheckReturnValue public final class ImmutableId<O> extends Id<O>
Id.
Use the builder to create immutable instances:
ImmutableId.builder().
Use the static factory method to create immutable instances:
ImmutableId.of().
| Modifier and Type | Class and Description |
|---|---|
static class |
ImmutableId.Builder<O>
Builds instances of type
ImmutableId. |
Id.ClearTypeCounter| Modifier and Type | Method and Description |
|---|---|
static <O> ImmutableId.Builder<O> |
builder()
Creates a builder for
ImmutableId. |
static <O> ImmutableId<O> |
copyOf(Id<O> instance)
Creates an immutable copy of a
Id value. |
protected int |
count() |
boolean |
equals(Object another)
This instance is equal to all instances of
ImmutableId that have equal attribute values. |
int |
hashCode()
Computes a hash code from attributes:
type, count. |
static <O> ImmutableId<O> |
of(Class<O> type,
int count)
Construct a new immutable
Id instance. |
protected Class<O> |
type() |
ImmutableId<O> |
withCount(int value)
Copy the current immutable object by setting a value for the
count attribute. |
ImmutableId<O> |
withType(Class<O> value)
Copy the current immutable object by setting a value for the
type attribute. |
asHumanReadable, asInstance, idFor, toString, withclone, finalize, getClass, notify, notifyAll, wait, wait, waitasHumanReadableprotected int count()
public final ImmutableId<O> withType(Class<O> value)
type attribute.
A shallow reference equality check is used to prevent copying of the same value by returning this.value - A new value for typethis objectpublic final ImmutableId<O> withCount(int value)
count attribute.
A value equality check is used to prevent copying of the same value by returning this.value - A new value for countthis objectpublic boolean equals(@Nullable Object another)
ImmutableId that have equal attribute values.public int hashCode()
type, count.public static <O> ImmutableId<O> of(Class<O> type, int count)
Id instance.O - generic parameter Otype - The value for the type attributecount - The value for the count attributepublic static <O> ImmutableId<O> copyOf(Id<O> instance)
Id value.
Uses accessors to get values to initialize the new immutable instance.
If an instance is already immutable, it is returned as is.O - generic parameter Oinstance - The instance to copypublic static <O> ImmutableId.Builder<O> builder()
ImmutableId.
ImmutableId.<O>builder()
.type(Class<O>) // required type
.count(int) // required count
.build();
O - generic parameter OCopyright © 2023. All rights reserved.