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