T
- the type of data that this event containspublic static interface ServerSentEvent.Builder<T>
SseEvent
.Modifier and Type | Method and Description |
---|---|
ServerSentEvent<T> |
build()
Builds the event.
|
ServerSentEvent.Builder<T> |
comment(java.lang.String comment)
Set SSE comment.
|
ServerSentEvent.Builder<T> |
data(T data)
Set the value of the
data field. |
ServerSentEvent.Builder<T> |
event(java.lang.String event)
Set the value of the
event field. |
ServerSentEvent.Builder<T> |
id(java.lang.String id)
Set the value of the
id field. |
ServerSentEvent.Builder<T> |
retry(java.time.Duration retry)
Set the value of the
retry field. |
ServerSentEvent.Builder<T> id(java.lang.String id)
id
field.id
- the value of the id fieldthis
builderServerSentEvent.Builder<T> event(java.lang.String event)
event
field.event
- the value of the event fieldthis
builderServerSentEvent.Builder<T> retry(java.time.Duration retry)
retry
field.retry
- the value of the retry fieldthis
builderServerSentEvent.Builder<T> comment(java.lang.String comment)
comment
- the comment to setthis
builderServerSentEvent.Builder<T> data(@Nullable T data)
data
field. If the data
argument is a multi-line
String
, it will be turned into multiple data
field lines as defined
in the Server-Sent Events W3C recommendation. If data
is not a String, it will
be encoded into JSON.data
- the value of the data fieldthis
builderServerSentEvent<T> build()