Package ratpack.sse
Interface ServerSentEventBuilder
-
public interface ServerSentEventBuilderA server sent event builder.- Since:
- 1.10
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description ServerSentEventbuild()Builds the event.ServerSentEventBuildercomment(java.lang.String comment)Specify a comment to include as part of this event.ServerSentEventBuilderdata(java.lang.String data)Specify the event data for the server sent event.ServerSentEventBuilderevent(java.lang.String event)Specify the event type for the server sent event.ServerSentEventBuilderid(java.lang.String id)Specify the event id for the server sent event.
-
-
-
Method Detail
-
id
ServerSentEventBuilder id(@Nullable java.lang.String id)
Specify the event id for the server sent event.The value must not contain a
'\n'character as this is not valid in an event value.- Parameters:
id- the event id- Returns:
- this
-
event
ServerSentEventBuilder event(@Nullable java.lang.String event)
Specify the event type for the server sent event.The value must not contain a
'\n'character as this is not valid in an event value.- Parameters:
event- the event type- Returns:
- this
-
data
ServerSentEventBuilder data(@Nullable java.lang.String data)
Specify the event data for the server sent event.- Parameters:
data- the event data- Returns:
- this
-
comment
ServerSentEventBuilder comment(@Nullable java.lang.String comment)
Specify a comment to include as part of this event.- Parameters:
comment- the comment data- Returns:
- this
-
build
ServerSentEvent build()
Builds the event.- Returns:
- the built event
-
-