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