接口 ServerSentEvent.Builder<T>
- 类型参数:
T- the type of data that this event contains
- 所有已知实现类:
ServerSentEvent.BuilderImpl
- 封闭类:
- ServerSentEvent<T>
public static interface ServerSentEvent.Builder<T>
A mutable builder for a
SseEvent.-
方法概要
修饰符和类型方法说明build()Builds the event.Set SSE comment.Set the value of thedatafield.Set the value of theeventfield.Set the value of theidfield.Set the value of theretryfield.
-
方法详细资料
-
id
Set the value of theidfield.- 参数:
id- the value of the id field- 返回:
thisbuilder
-
event
Set the value of theeventfield.- 参数:
event- the value of the event field- 返回:
thisbuilder
-
retry
Set the value of theretryfield.- 参数:
retry- the value of the retry field- 返回:
thisbuilder
-
comment
Set SSE comment. If a multi-line comment is provided, it will be turned into multiple SSE comment lines as defined in Server-Sent Events W3C recommendation.- 参数:
comment- the comment to set- 返回:
thisbuilder
-
data
Set the value of thedatafield. If thedataargument is a multi-lineString, it will be turned into multipledatafield lines as defined in the Server-Sent Events W3C recommendation. Ifdatais not a String, it will be encoded into JSON.- 参数:
data- the value of the data field- 返回:
thisbuilder
-
build
ServerSentEvent<T> build()Builds the event.- 返回:
- the built event
-