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