Package org.springframework.http.codec
Interface ServerSentEvent.Builder<T>
- Type Parameters:
- T- the type of data that this event contains
- Enclosing class:
- ServerSentEvent<T>
public static interface ServerSentEvent.Builder<T>
A mutable builder for a 
SseEvent.- 
Method SummaryModifier and TypeMethodDescriptionbuild()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.
- 
Method Details- 
idSet the value of theidfield.- Parameters:
- id- the value of the id field
- Returns:
- thisbuilder
 
- 
eventSet the value of theeventfield.- Parameters:
- event- the value of the event field
- Returns:
- thisbuilder
 
- 
retrySet the value of theretryfield.- Parameters:
- retry- the value of the retry field
- Returns:
- thisbuilder
 
- 
commentSet 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.- Parameters:
- comment- the comment to set
- Returns:
- thisbuilder
 
- 
dataSet 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.- Parameters:
- data- the value of the data field
- Returns:
- thisbuilder
 
- 
buildServerSentEvent<T> build()Builds the event.- Returns:
- the built event
 
 
-