@NotThreadSafe public static final class ImmutableId.Builder<O> extends Object
ImmutableId.
Initialize attributes and then invoke the build() method to create an
immutable instance.
Builder is not thread-safe and generally should not be stored in a field or collection,
but instead used immediately to create instances.
| Modifier and Type | Method and Description |
|---|---|
ImmutableId<O> |
build()
Builds a new
ImmutableId. |
ImmutableId.Builder<O> |
count(int count)
Initializes the value for the
count attribute. |
ImmutableId.Builder<O> |
from(Id<O> instance)
Fill a builder with attribute values from the provided
Id instance. |
ImmutableId.Builder<O> |
type(Class<O> type)
Initializes the value for the
type attribute. |
@CanIgnoreReturnValue public final ImmutableId.Builder<O> from(Id<O> instance)
Id instance.
Regular attribute values will be replaced with those from the given instance.
Absent optional values will not replace present values.instance - The instance from which to copy valuesthis builder for use in a chained invocation@CanIgnoreReturnValue public final ImmutableId.Builder<O> type(Class<O> type)
type attribute.type - The value for typethis builder for use in a chained invocation@CanIgnoreReturnValue public final ImmutableId.Builder<O> count(int count)
count attribute.count - The value for countthis builder for use in a chained invocationpublic ImmutableId<O> build()
ImmutableId.IllegalStateException - if any required attributes are missingCopyright © 2023. All rights reserved.