Package javax.ws.rs.sse
Interface InboundSseEvent
-
-
Field Summary
-
Fields inherited from interface javax.ws.rs.sse.SseEvent
RECONNECT_NOT_SET
-
-
Method Summary
Modifier and Type Method Description boolean
isEmpty()
Check if the event is empty (i.e.String
readData()
Get the original event data asString
.<T> T
readData(Class<T> type)
Read event data as a given Java type.<T> T
readData(Class<T> messageType, MediaType mediaType)
Read event data as a given Java type.<T> T
readData(GenericType<T> type)
Read event data as a given generic type.<T> T
readData(GenericType<T> type, MediaType mediaType)
Read event data as a given generic type.-
Methods inherited from interface javax.ws.rs.sse.SseEvent
getComment, getId, getName, getReconnectDelay, isReconnectDelaySet
-
-
-
-
Method Detail
-
isEmpty
boolean isEmpty()
Check if the event is empty (i.e. does not contain any data).- Returns:
true
if current instance does not contain any data,false
otherwise.
-
readData
String readData()
Get the original event data asString
.- Returns:
- event data de-serialized into a string.
- Throws:
ProcessingException
- when provided type can't be read. The thrown exception wraps the original cause.
-
readData
<T> T readData(Class<T> type)
Read event data as a given Java type.- Parameters:
type
- Java type to be used for event data de-serialization.- Returns:
- event data de-serialized as an instance of a given type.
- Throws:
ProcessingException
- when provided type can't be read. The thrown exception wraps the original cause.
-
readData
<T> T readData(GenericType<T> type)
Read event data as a given generic type.- Parameters:
type
- generic type to be used for event data de-serialization.- Returns:
- event data de-serialized as an instance of a given type.
- Throws:
ProcessingException
- when provided type can't be read. The thrown exception wraps the original cause.
-
readData
<T> T readData(Class<T> messageType, MediaType mediaType)
Read event data as a given Java type.- Parameters:
messageType
- Java type to be used for event data de-serialization.mediaType
-media type
to be used for event data de-serialization.- Returns:
- event data de-serialized as an instance of a given type.
- Throws:
ProcessingException
- when provided type can't be read. The thrown exception wraps the original cause.
-
readData
<T> T readData(GenericType<T> type, MediaType mediaType)
Read event data as a given generic type.- Parameters:
type
- generic type to be used for event data de-serialization.mediaType
-media type
to be used for event data de-serialization.- Returns:
- event data de-serialized as an instance of a given type.
- Throws:
ProcessingException
- when provided type can't be read. The thrown exception wraps the original cause.
-
-