@ParametersAreNonnullByDefault @Generated(value="org.immutables.processor.ProxyProcessor") @Immutable @CheckReturnValue public final class ImmutableAttribute<O,T> extends Attribute<O,T>
Attribute.
Use the builder to create immutable instances:
ImmutableAttribute.builder().
| Modifier and Type | Class and Description |
|---|---|
static class |
ImmutableAttribute.Builder<O,T>
Builds instances of type
ImmutableAttribute. |
| Modifier and Type | Method and Description |
|---|---|
static <O,T> ImmutableAttribute.Builder<O,T> |
builder()
Creates a builder for
ImmutableAttribute. |
static <O,T> ImmutableAttribute<O,T> |
copyOf(Attribute<O,T> instance)
Creates an immutable copy of a
Attribute value. |
boolean |
equals(Object another)
This instance is equal to all instances of
ImmutableAttribute that have equal attribute values. |
protected Function<O,T> |
getter() |
int |
hashCode()
Computes a hash code from attributes:
objectType, name, getter, setter. |
protected String |
name() |
protected Class<O> |
objectType() |
protected BiConsumer<O,T> |
setter() |
ImmutableAttribute<O,T> |
withGetter(Function<O,T> value)
Copy the current immutable object by setting a value for the
getter attribute. |
ImmutableAttribute<O,T> |
withName(String value)
Copy the current immutable object by setting a value for the
name attribute. |
ImmutableAttribute<O,T> |
withObjectType(Class<O> value)
Copy the current immutable object by setting a value for the
objectType attribute. |
ImmutableAttribute<O,T> |
withSetter(BiConsumer<O,T> value)
Copy the current immutable object by setting a value for the
setter attribute. |
get, isMatchingInstance, of, set, toStringclone, finalize, getClass, notify, notifyAll, wait, wait, waitnamed, ofType, relatedTo, unvalidatedprotected Class<O> objectType()
objectType in class Attribute<O,T>objectType attributeprotected String name()
protected BiConsumer<O,T> setter()
public final ImmutableAttribute<O,T> withObjectType(Class<O> value)
objectType attribute.
A shallow reference equality check is used to prevent copying of the same value by returning this.value - A new value for objectTypethis objectpublic final ImmutableAttribute<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 ImmutableAttribute<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 ImmutableAttribute<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)
ImmutableAttribute that have equal attribute values.public int hashCode()
objectType, name, getter, setter.public static <O,T> ImmutableAttribute<O,T> copyOf(Attribute<O,T> instance)
Attribute 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> ImmutableAttribute.Builder<O,T> builder()
ImmutableAttribute.
ImmutableAttribute.<O, T>builder()
.objectType(Class<O>) // required objectType
.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.