T - The type of the wrapped objectpublic class Event<T>
extends java.lang.Object
implements java.io.Serializable, reactor.core.alloc.Recyclable
Consumers.| Modifier and Type | Class and Description |
|---|---|
static class |
Event.Headers
Headers are a Map-like structure of name-value pairs.
|
| Constructor and Description |
|---|
Event(java.lang.Class<T> klass)
Creates a new Event based on the type T of
|
Event(Event.Headers headers,
T data)
Creates a new Event with the given
headers and data. |
Event(Event.Headers headers,
T data,
reactor.fn.Consumer<java.lang.Throwable> errorConsumer)
Creates a new Event with the given
headers, data and . |
Event(T data)
Creates a new Event with the given
data. |
| Modifier and Type | Method and Description |
|---|---|
void |
consumeError(java.lang.Throwable throwable)
Consumes error, using a producer defined callback
|
Event<T> |
copy()
Create a copy of this event, reusing same headers, data and replyTo
|
<E> Event<E> |
copy(E data)
Create a copy of this event, reusing same headers and replyTo
|
T |
getData()
Get the internal data being wrapped.
|
reactor.fn.Consumer<java.lang.Throwable> |
getErrorConsumer()
Get the internal error consumer callback being wrapped.
|
Event.Headers |
getHeaders()
Get the
Event.Headers attached to this event. |
java.util.UUID |
getId()
Get the globally-unique id of this event.
|
java.lang.Object |
getKey()
Get the key this event was notified on.
|
java.lang.Object |
getReplyTo()
Get the key to send replies to.
|
void |
override(Event<T> ev) |
void |
recycle() |
Event<T> |
setData(T data)
Set the internal data to wrap.
|
Event<T> |
setKey(java.lang.Object key)
Set the key this event is being notified with.
|
Event<T> |
setReplyTo(java.lang.Object replyTo)
Set the
key that interested parties should send replies to. |
java.lang.String |
toString() |
static <T> Event<T> |
wrap(T obj)
Wrap the given object with an
Event. |
static <T> Event<T> |
wrap(T obj,
java.lang.Object replyToKey)
|
public Event(java.lang.Class<T> klass)
klass - public Event(Event.Headers headers, T data)
headers and data.headers - The headersdata - The datapublic Event(Event.Headers headers, T data, reactor.fn.Consumer<java.lang.Throwable> errorConsumer)
headers, data and .headers - The headersdata - The dataerrorConsumer - error consumer callbackpublic Event(T data)
data. The event will have empty headers.data - The datapublic static <T> Event<T> wrap(T obj)
Event.obj - The object to wrap.Event.public static <T> Event<T> wrap(T obj, java.lang.Object replyToKey)
T - The type of the given object.obj - The object to wrap.replyToKey - The key to use as a replyTo.Event.public java.util.UUID getId()
UUID of this event.public Event.Headers getHeaders()
Event.Headers attached to this event.public java.lang.Object getReplyTo()
public Event<T> setReplyTo(java.lang.Object replyTo)
key that interested parties should send replies to.replyTo - The key to use to notify sender of replies.public java.lang.Object getKey()
public Event<T> setKey(java.lang.Object key)
key - The key used to notify consumers of this event.public T getData()
public Event<T> setData(T data)
data - Data to wrap.public reactor.fn.Consumer<java.lang.Throwable> getErrorConsumer()
public Event<T> copy()
public <E> Event<E> copy(E data)
public void consumeError(java.lang.Throwable throwable)
throwable - The error to consumepublic void recycle()
recycle in interface reactor.core.alloc.Recyclablepublic java.lang.String toString()
toString in class java.lang.Object