java.lang.Object
io.helidon.http.sse.SseEvent.Builder
- All Implemented Interfaces:
Builder<SseEvent.Builder,
,SseEvent> Supplier<SseEvent>
- Enclosing class:
SseEvent
Fluent API builder for
SseEvent
.-
Method Summary
Modifier and TypeMethodDescriptionbuild()
Build the instance from this builder.Set comment string associated with the event.Set event data.Set the event id.mediaContext
(MediaContext mediaContext) Set the media context for this event.Set the media type for the event data.Set event name.reconnectDelay
(Duration reconnectMillis) Set reconnection delay that indicates how long the event receiver should wait before attempting to reconnect in case a connection is lost.
-
Method Details
-
build
Description copied from interface:Builder
Build the instance from this builder.- Specified by:
build
in interfaceBuilder<SseEvent.Builder,
SseEvent> - Returns:
- instance of the built type
-
id
Set the event id. Optional.- Parameters:
id
- the id- Returns:
- updated builder instance
-
name
Set event name. Optional.- Parameters:
name
- event name- Returns:
- updated builder instance
-
comment
Set comment string associated with the event. Optional. The comment will be serialized with the event, before event data is serialized.- Parameters:
comment
- comment string- Returns:
- updated builder instance
-
mediaType
Set the media type for the event data. Default value isMediaTypes.TEXT_PLAIN
.- Parameters:
mediaType
- media type of event data- Returns:
- updated builder instance
-
data
Set event data.- Parameters:
data
- event data- Returns:
- updated builder instance
-
reconnectDelay
Set reconnection delay that indicates how long the event receiver should wait before attempting to reconnect in case a connection is lost. Optional.- Parameters:
reconnectMillis
- reconnection delay- Returns:
- updated builder instance
-
mediaContext
Set the media context for this event. This is only required for deserialization of events.- Parameters:
mediaContext
- the media context- Returns:
- updated builder instance
- See Also:
-