public interface ServerSentEvent
Publisher or Stream produces objects which implement this interface, it can be
converted into a text event stream by ServerSentEventResponseConverterFunction.| Modifier and Type | Method and Description |
|---|---|
static ServerSentEventBuilder |
builder()
Returns a newly created
ServerSentEventBuilder. |
String |
comment()
Returns a comment of this event, if it exists.
|
String |
data()
Returns a data of this event, if it exists.
|
static ServerSentEvent |
empty()
Returns a singleton empty
ServerSentEvent. |
String |
event()
Returns an event name of this event, if it exists.
|
String |
id()
Returns an ID of this event, if it exists.
|
static ServerSentEvent |
ofComment(String comment)
Creates a new
ServerSentEvent with the specified comment. |
static ServerSentEvent |
ofData(String data)
Creates a new
ServerSentEvent with the specified data. |
static ServerSentEvent |
ofEvent(String event)
Creates a new
ServerSentEvent with the specified event. |
static ServerSentEvent |
ofId(String id)
Creates a new
ServerSentEvent with the specified id. |
static ServerSentEvent |
ofRetry(Duration retry)
Creates a new
ServerSentEvent with the specified retry. |
Duration |
retry()
Returns a reconnection time in milliseconds, if it exists.
|
static ServerSentEvent empty()
ServerSentEvent.static ServerSentEvent ofId(String id)
ServerSentEvent with the specified id.static ServerSentEvent ofEvent(String event)
ServerSentEvent with the specified event.static ServerSentEvent ofRetry(Duration retry)
ServerSentEvent with the specified retry.static ServerSentEvent ofComment(String comment)
ServerSentEvent with the specified comment.static ServerSentEvent ofData(String data)
ServerSentEvent with the specified data.static ServerSentEventBuilder builder()
ServerSentEventBuilder.String id()
null will be returned.String event()
null will be returned.Duration retry()
null will be returned.String comment()
null will be returned.String data()
null will be returned.Copyright © 2020 LeanCloud. All rights reserved.