@ParametersAreNonnullByDefault @Generated(value="org.immutables.processor.ProxyProcessor") @Immutable @CheckReturnValue public final class ImmutableMappedValue<T> extends Object implements MappedValue<T>
MappedValue.
Use the builder to create immutable instances:
ImmutableMappedValue.builder().
Use the static factory method to create immutable instances:
ImmutableMappedValue.of().
| Modifier and Type | Class and Description |
|---|---|
static class |
ImmutableMappedValue.Builder<T>
Builds instances of type
ImmutableMappedValue. |
| Modifier and Type | Method and Description |
|---|---|
static <T> ImmutableMappedValue.Builder<T> |
builder()
Creates a builder for
ImmutableMappedValue. |
static <T> ImmutableMappedValue<T> |
copyOf(MappedValue<T> instance)
Creates an immutable copy of a
MappedValue value. |
boolean |
equals(Object another)
This instance is equal to all instances of
ImmutableMappedValue that have equal attribute values. |
int |
hashCode()
Computes a hash code from attributes:
id, value. |
Value<T> |
id() |
static <T> ImmutableMappedValue<T> |
of(Value<T> id,
T value)
Construct a new immutable
MappedValue instance. |
String |
toString()
Prints the immutable value
MappedValue with attribute values. |
T |
value() |
ImmutableMappedValue<T> |
withId(Value<T> value)
Copy the current immutable object by setting a value for the
id attribute. |
ImmutableMappedValue<T> |
withValue(T value)
Copy the current immutable object by setting a value for the
value attribute. |
public Value<T> id()
id in interface MappedValue<T>id attribute@Nullable public T value()
value in interface MappedValue<T>value attributepublic final ImmutableMappedValue<T> withId(Value<T> value)
id attribute.
A shallow reference equality check is used to prevent copying of the same value by returning this.value - A new value for idthis objectpublic final ImmutableMappedValue<T> withValue(@Nullable T value)
value attribute.
A shallow reference equality check is used to prevent copying of the same value by returning this.value - A new value for value (can be null)this objectpublic boolean equals(@Nullable Object another)
ImmutableMappedValue that have equal attribute values.public int hashCode()
id, value.public String toString()
MappedValue with attribute values.public static <T> ImmutableMappedValue<T> of(Value<T> id, @Nullable T value)
MappedValue instance.of in interface MappedValue<T>T - generic parameter Tid - The value for the id attributevalue - The value for the value attributepublic static <T> ImmutableMappedValue<T> copyOf(MappedValue<T> instance)
MappedValue value.
Uses accessors to get values to initialize the new immutable instance.
If an instance is already immutable, it is returned as is.T - generic parameter Tinstance - The instance to copypublic static <T> ImmutableMappedValue.Builder<T> builder()
ImmutableMappedValue.
ImmutableMappedValue.<T>builder()
.id(de.flapdoodle.formula.Value<T>) // required id
.value(T | null) // nullable value
.build();
T - generic parameter TCopyright © 2023. All rights reserved.