java.lang.Object
io.helidon.http.sse.SseEvent
An SSE event.
-
Nested Class Summary
-
Field Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic SseEvent.Builder
builder()
Creates builder for this class.comment()
Get optional comment for this event.static SseEvent
Creates a new SSE event with data.static SseEvent
Creates a new SSE event with data and media type.data()
Get data for this event.<T> T
Get data for this event as type T.<T> T
Get data for this event as type T.id()
Get optional ID for this event.Get optional media context for this event.Get optional media type for this event.name()
Get optional name for this event.Get optional reconnect for this event.
-
Field Details
-
NO_DATA
Value returned bydata()
when no data has been set.
-
-
Method Details
-
create
Creates a new SSE event with data.- Parameters:
data
- data for the event- Returns:
- newly created SSE event
-
create
Creates a new SSE event with data and media type.- Parameters:
data
- data for the eventmediaType
- media type for this event if not text/plain- Returns:
- newly created SSE event
-
builder
Creates builder for this class.- Returns:
- new builder
-
data
Get data for this event.- Returns:
- the data or
NO_DATA
-
data
Get data for this event as type T. Uses media support to convert event data to type T.- Type Parameters:
T
- the converted type- Parameters:
clazz
- the classmediaType
- media type of event data- Returns:
- the converted data
-
data
Get data for this event as type T. Uses media support to convert event data to type T.- Type Parameters:
T
- the converted type- Parameters:
clazz
- the class- Returns:
- the converted data
-
mediaType
Get optional media type for this event. If the media type is specified here, it will be used for serialization purposes.- Returns:
- the media type
-
mediaContext
Get optional media context for this event. If the media type is specified here, it will be used for deserialization purposes.- Returns:
- the media type
- See Also:
-
id
Get optional ID for this event.- Returns:
- optional ID
-
name
Get optional name for this event.- Returns:
- optional name
-
comment
Get optional comment for this event.- Returns:
- optional comment
-
reconnectMillis
Get optional reconnect for this event.- Returns:
- optional reconnect
-