- All Known Subinterfaces:
MessageBodyContext.ErrorEvent
- Enclosing class:
- MessageBodyContext
public static interface MessageBodyContext.Event
Message body content subscription event contract.
-
Method Summary
Modifier and TypeMethodDescriptiondefault MessageBodyContext.ErrorEvent
Fluent helper method to cast this event as aMessageBodyContext.ErrorEvent
.Optional<GenericType<?>>
Get the type requested for conversion.Get the event type of this event.
-
Method Details
-
eventType
MessageBodyContext.EventType eventType()Get the event type of this event.- Returns:
- EVENT_TYPE
-
entityType
Optional<GenericType<?>> entityType()Get the type requested for conversion.- Returns:
- never
null
-
asErrorEvent
Fluent helper method to cast this event as aMessageBodyContext.ErrorEvent
. This is safe to do wheneventType()
returnsMessageBodyContext.EventType.BEFORE_ONERROR
orMessageBodyContext.EventType.AFTER_ONERROR
- Returns:
- ErrorEvent
- Throws:
IllegalStateException
- if this event is not an instance ofMessageBodyContext.ErrorEvent
-