Class SseEvent.Builder
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.Use an array of strings to set the value of a multi-line event.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.Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface Builder
get, identity, updateModifier and TypeMethodDescriptiondefault SseEventget()default SseEvent.Builderidentity()Instance of this builder as the correct type.default SseEvent.Builderupdate(Consumer<SseEvent.Builder> consumer) Update the builder in a fluent API way.
-
Method Details
-
build
-
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
-
data
Use an array of strings to set the value of a multi-line event.- Parameters:
data- array of strings- 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:
-