@Generated(value={"Immutables.generator","NamedTypeAndValue<T>"}) public final class ImmutableNamedTypeAndValue<T> extends Object implements NamedTypeAndValue<T>
NamedTypeAndValue.
Use the builder to create immutable instances:
ImmutableNamedTypeAndValue.<T>builder().
Use the static factory method to create immutable instances:
ImmutableNamedTypeAndValue.<T>of().
| Modifier and Type | Class and Description |
|---|---|
static class |
ImmutableNamedTypeAndValue.Builder<T>
Builds instances of type
ImmutableNamedTypeAndValue. |
| Modifier and Type | Method and Description |
|---|---|
static <T> ImmutableNamedTypeAndValue.Builder<T> |
builder()
Creates a builder for
ImmutableNamedTypeAndValue. |
static <T> ImmutableNamedTypeAndValue<T> |
copyOf(NamedTypeAndValue<T> instance)
Creates an immutable copy of a
NamedTypeAndValue value. |
boolean |
equals(Object another)
This instance is equal to all instances of
ImmutableNamedTypeAndValue that have equal attribute values. |
int |
hashCode()
Computes a hash code from attributes:
type, value. |
static <T> ImmutableNamedTypeAndValue<T> |
of(NamedType<T> type,
T value)
Construct a new immutable
NamedTypeAndValue instance. |
String |
toString()
Prints the immutable value
NamedTypeAndValue with attribute values. |
NamedType<T> |
type() |
T |
value() |
ImmutableNamedTypeAndValue<T> |
withType(NamedType<T> value)
Copy the current immutable object by setting a value for the
type attribute. |
ImmutableNamedTypeAndValue<T> |
withValue(T value)
Copy the current immutable object by setting a value for the
value attribute. |
public NamedType<T> type()
type in interface NamedTypeAndValue<T>type attributepublic T value()
value in interface NamedTypeAndValue<T>value attributepublic final ImmutableNamedTypeAndValue<T> withType(NamedType<T> 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 ImmutableNamedTypeAndValue<T> withValue(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 valuethis objectpublic boolean equals(Object another)
ImmutableNamedTypeAndValue that have equal attribute values.public int hashCode()
type, value.public String toString()
NamedTypeAndValue with attribute values.public static <T> ImmutableNamedTypeAndValue<T> of(NamedType<T> type, T value)
NamedTypeAndValue instance.of in interface NamedTypeAndValue<T>type - The value for the type attributevalue - The value for the value attributepublic static <T> ImmutableNamedTypeAndValue<T> copyOf(NamedTypeAndValue<T> instance)
NamedTypeAndValue 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> ImmutableNamedTypeAndValue.Builder<T> builder()
ImmutableNamedTypeAndValue.T - generic parameter TCopyright © 2017. All rights reserved.