@NotThreadSafe public static final class ImmutableCopyOnChangeProperty.Builder<O,T> extends Object
ImmutableCopyOnChangeProperty.
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 |
|---|---|
ImmutableCopyOnChangeProperty<O,T> |
build()
Builds a new
ImmutableCopyOnChangeProperty. |
ImmutableCopyOnChangeProperty.Builder<O,T> |
copyOnWrite(BiFunction<O,T,O> copyOnWrite)
Initializes the value for the
copyOnWrite attribute. |
ImmutableCopyOnChangeProperty.Builder<O,T> |
from(CopyOnChangeProperty<O,T> instance)
Fill a builder with attribute values from the provided
CopyOnChangeProperty instance. |
ImmutableCopyOnChangeProperty.Builder<O,T> |
getter(Function<O,T> getter)
Initializes the value for the
getter attribute. |
ImmutableCopyOnChangeProperty.Builder<O,T> |
name(String name)
Initializes the value for the
name attribute. |
ImmutableCopyOnChangeProperty.Builder<O,T> |
type(Class<O> type)
Initializes the value for the
type attribute. |
@CanIgnoreReturnValue public final ImmutableCopyOnChangeProperty.Builder<O,T> from(CopyOnChangeProperty<O,T> instance)
CopyOnChangeProperty 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 ImmutableCopyOnChangeProperty.Builder<O,T> type(Class<O> type)
type attribute.type - The value for typethis builder for use in a chained invocation@CanIgnoreReturnValue public final ImmutableCopyOnChangeProperty.Builder<O,T> name(String name)
name attribute.name - The value for namethis builder for use in a chained invocation@CanIgnoreReturnValue public final ImmutableCopyOnChangeProperty.Builder<O,T> getter(Function<O,T> getter)
getter attribute.getter - The value for getterthis builder for use in a chained invocation@CanIgnoreReturnValue public final ImmutableCopyOnChangeProperty.Builder<O,T> copyOnWrite(BiFunction<O,T,O> copyOnWrite)
copyOnWrite attribute.copyOnWrite - The value for copyOnWritethis builder for use in a chained invocationpublic ImmutableCopyOnChangeProperty<O,T> build()
ImmutableCopyOnChangeProperty.IllegalStateException - if any required attributes are missingCopyright © 2023. All rights reserved.