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