@ParametersAreNonnullByDefault @Generated(value="org.immutables.processor.ProxyProcessor") @Immutable @CheckReturnValue public final class ImmutableModifiableProperty<O,T> extends ModifiableProperty<O,T>
ModifiableProperty.
Use the builder to create immutable instances:
ImmutableModifiableProperty.builder().
Use the static factory method to create immutable instances:
ImmutableModifiableProperty.of().
| Modifier and Type | Class and Description |
|---|---|
static class |
ImmutableModifiableProperty.Builder<O,T>
Builds instances of type
ImmutableModifiableProperty. |
| Modifier and Type | Method and Description |
|---|---|
static <O,T> ImmutableModifiableProperty.Builder<O,T> |
builder()
Creates a builder for
ImmutableModifiableProperty. |
static <O,T> ImmutableModifiableProperty<O,T> |
copyOf(ModifiableProperty<O,T> instance)
Creates an immutable copy of a
ModifiableProperty value. |
boolean |
equals(Object another)
This instance is equal to all instances of
ImmutableModifiableProperty that have equal attribute values. |
protected Function<O,T> |
getter() |
int |
hashCode()
Computes a hash code from attributes:
type, name, getter, setter. |
protected String |
name() |
static <O,T> ImmutableModifiableProperty<O,T> |
of(Class<O> type,
String name,
Function<O,T> getter,
BiConsumer<O,T> setter)
Construct a new immutable
ModifiableProperty instance. |
protected BiConsumer<O,T> |
setter() |
protected Class<O> |
type() |
ImmutableModifiableProperty<O,T> |
withGetter(Function<O,T> value)
Copy the current immutable object by setting a value for the
getter attribute. |
ImmutableModifiableProperty<O,T> |
withName(String value)
Copy the current immutable object by setting a value for the
name attribute. |
ImmutableModifiableProperty<O,T> |
withSetter(BiConsumer<O,T> value)
Copy the current immutable object by setting a value for the
setter attribute. |
ImmutableModifiableProperty<O,T> |
withType(Class<O> value)
Copy the current immutable object by setting a value for the
type attribute. |
asHumanReadable, get, set, toString, withIdclone, finalize, getClass, notify, notifyAll, wait, wait, waitasHumanReadableprotected Class<O> type()
type in class ModifiableProperty<O,T>type attributeprotected String name()
name in class ModifiableProperty<O,T>name attributeprotected Function<O,T> getter()
getter in class ModifiableProperty<O,T>getter attributeprotected BiConsumer<O,T> setter()
setter in class ModifiableProperty<O,T>setter attributepublic final ImmutableModifiableProperty<O,T> 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 ImmutableModifiableProperty<O,T> withName(String value)
name attribute.
An equals check used to prevent copying of the same value by returning this.value - A new value for namethis objectpublic final ImmutableModifiableProperty<O,T> withGetter(Function<O,T> value)
getter attribute.
A shallow reference equality check is used to prevent copying of the same value by returning this.value - A new value for getterthis objectpublic final ImmutableModifiableProperty<O,T> withSetter(BiConsumer<O,T> value)
setter attribute.
A shallow reference equality check is used to prevent copying of the same value by returning this.value - A new value for setterthis objectpublic boolean equals(@Nullable Object another)
ImmutableModifiableProperty that have equal attribute values.public int hashCode()
type, name, getter, setter.public static <O,T> ImmutableModifiableProperty<O,T> of(Class<O> type, String name, Function<O,T> getter, BiConsumer<O,T> setter)
ModifiableProperty instance.O - generic parameter OT - generic parameter Ttype - The value for the type attributename - The value for the name attributegetter - The value for the getter attributesetter - The value for the setter attributepublic static <O,T> ImmutableModifiableProperty<O,T> copyOf(ModifiableProperty<O,T> instance)
ModifiableProperty 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 OT - generic parameter Tinstance - The instance to copypublic static <O,T> ImmutableModifiableProperty.Builder<O,T> builder()
ImmutableModifiableProperty.
ImmutableModifiableProperty.<O, T>builder()
.type(Class<O>) // required type
.name(String) // required name
.getter(function.Function<O, T>) // required getter
.setter(function.BiConsumer<O, T>) // required setter
.build();
O - generic parameter OT - generic parameter TCopyright © 2023. All rights reserved.