Class Event
java.lang.Object
org.nanonative.nano.helper.event.model.Event
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionacknowledge(Runnable response) berlin.yuna.typemap.model.TypeMapcache()intchannelId(int channelId) intcontext()longerror()<T> Event<T> EventifPresentAck(int channelId, Class<T> clazz, Consumer<T> consumer) ifPresentAck(int channelId, Consumer<Event> consumer) booleanlogger()name()nameOrg()nano()payload()<T> T<T> Optional<T> payloadOpt(Class<T> type) response()<T> T<T> Optional<T> responseOpt(Class<T> type) toString()
-
Field Details
-
channelId
protected int channelId -
createdAtMs
protected final long createdAtMs -
context
-
responseListener
-
payload
-
cache
protected berlin.yuna.typemap.model.TypeMap cache -
response
-
error
-
EVENT_ORIGINAL_CHANNEL_ID
- See Also:
-
-
Constructor Details
-
Event
Constructs an instance of the Event class with specified type, context, payload, and response listener. This event object can be used to trigger specific actions or responses based on the event type and payload.- Parameters:
channelId- The integer representing the type of the event. This typically corresponds to a specific kind of event.context- TheContextin which the event is created and processed. It provides environmental data and configurations.payload- The data or object that is associated with this event. This can be any relevant information that needs to be passed along with the event.responseListener- A consumer that handles the response of the event processing. It can be used to execute actions based on the event's outcome or data.
-
-
Method Details
-
name
-
nameOrg
-
nano
-
channelId
public int channelId() -
channelIdOrg
public int channelIdOrg() -
channelId
-
createdAtMs
public long createdAtMs() -
ifPresent
-
ifPresentAck
-
ifPresent
-
ifPresentAck
-
logger
-
payload
-
isAcknowledged
public boolean isAcknowledged() -
payloadOpt
-
payload
-
payloadOpt
-
context
-
responseListener
-
acknowledge
-
acknowledge
-
response
-
response
-
responseOpt
-
response
-
peek
-
put
-
cache
-
cache
public berlin.yuna.typemap.model.TypeMap cache() -
error
-
error
-
toString
-