@NotThreadSafe public static final class ImmutableRelated.Builder<T,B> extends Object
ImmutableRelated.
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 |
|---|---|
ImmutableRelated<T,B> |
build()
Builds a new
ImmutableRelated. |
ImmutableRelated.Builder<T,B> |
destination(Value<T> destination)
Initializes the value for the
destination attribute. |
ImmutableRelated.Builder<T,B> |
from(Related<T,B> instance)
Fill a builder with attribute values from the provided
Related instance. |
ImmutableRelated.Builder<T,B> |
reference(B reference)
Initializes the value for the
reference attribute. |
@CanIgnoreReturnValue public final ImmutableRelated.Builder<T,B> from(Related<T,B> instance)
Related 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 ImmutableRelated.Builder<T,B> destination(Value<T> destination)
destination attribute.destination - The value for destinationthis builder for use in a chained invocation@CanIgnoreReturnValue public final ImmutableRelated.Builder<T,B> reference(B reference)
reference attribute.reference - The value for referencethis builder for use in a chained invocationpublic ImmutableRelated<T,B> build()
ImmutableRelated.IllegalStateException - if any required attributes are missingCopyright © 2023. All rights reserved.