@Generated(value="org.immutables.processor.ProxyProcessor") public final class ImmutableStateListener<T> extends Object implements Listener.StateListener<T>
Listener.StateListener.
Use the builder to create immutable instances:
ImmutableStateListener.builder().
Use the static factory method to create immutable instances:
ImmutableStateListener.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(Listener.StateListener<T> instance)
Creates an immutable copy of a
Listener.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(StateID<T> type,
Consumer<T> listener)
Construct a new immutable
StateListener instance. |
String |
toString()
Prints the immutable value
StateListener with attribute values. |
StateID<T> |
type() |
ImmutableStateListener<T> |
withListener(Consumer<T> value)
Copy the current immutable object by setting a value for the
listener attribute. |
ImmutableStateListener<T> |
withType(StateID<T> value)
Copy the current immutable object by setting a value for the
type attribute. |
public StateID<T> type()
type in interface Listener.StateListener<T>type attributepublic Consumer<T> listener()
listener in interface Listener.StateListener<T>listener attributepublic final ImmutableStateListener<T> withType(StateID<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(StateID<T> type, Consumer<T> listener)
StateListener instance.of in interface Listener.StateListener<T>T - generic parameter Ttype - The value for the type attributelistener - The value for the listener attributepublic static <T> ImmutableStateListener<T> copyOf(Listener.StateListener<T> instance)
Listener.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.
ImmutableStateListener.<T>builder()
.type(de.flapdoodle.reverse.StateID<T>) // required type
.listener(function.Consumer<T>) // required listener
.build();
T - generic parameter TCopyright © 2023. All rights reserved.