public final class ServerSentEvent extends ServerSentEvent implements scala.Product, java.io.Serializable
Constructor and Description |
---|
ServerSentEvent(java.lang.String data,
scala.Option<java.lang.String> eventType,
scala.Option<java.lang.String> id,
scala.Option<java.lang.Object> retry) |
Modifier and Type | Method and Description |
---|---|
static ServerSentEvent |
apply(java.lang.String data,
int retry)
Creates a
ServerSentEvent . |
static ServerSentEvent |
apply(java.lang.String data,
java.lang.String type)
Creates a
ServerSentEvent . |
static ServerSentEvent |
apply(java.lang.String data,
java.lang.String type,
java.lang.String id)
Creates a
ServerSentEvent . |
java.lang.String |
data() |
org.apache.pekko.util.ByteString |
encode() |
scala.Option<java.lang.String> |
eventType() |
java.lang.String |
getData()
Data, may span multiple lines.
|
java.util.Optional<java.lang.String> |
getEventType()
Optional type, must not contain \n or \r.
|
java.util.Optional<java.lang.String> |
getId()
Optional id, must not contain \n or \r.
|
java.util.OptionalInt |
getRetry()
Optional reconnection delay in milliseconds.
|
static ServerSentEvent |
heartbeat() |
scala.Option<java.lang.String> |
id() |
scala.Option<java.lang.Object> |
retry() |
create, create, create, create, create
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
public ServerSentEvent(java.lang.String data, scala.Option<java.lang.String> eventType, scala.Option<java.lang.String> id, scala.Option<java.lang.Object> retry)
public static ServerSentEvent heartbeat()
public static ServerSentEvent apply(java.lang.String data, java.lang.String type)
ServerSentEvent
.
data
- data, may span multiple linestype
- type, must not contain \n or \rpublic static ServerSentEvent apply(java.lang.String data, java.lang.String type, java.lang.String id)
ServerSentEvent
.
data
- data, may span multiple linestype
- type, must not contain \n or \rid
- id, must not contain \n or \rpublic static ServerSentEvent apply(java.lang.String data, int retry)
ServerSentEvent
.
data
- data, may span multiple linesretry
- reconnection delay in millisecondspublic java.lang.String data()
public scala.Option<java.lang.String> eventType()
public scala.Option<java.lang.String> id()
public scala.Option<java.lang.Object> retry()
public org.apache.pekko.util.ByteString encode()
public java.lang.String getData()
ServerSentEvent
getData
in class ServerSentEvent
public java.util.Optional<java.lang.String> getEventType()
ServerSentEvent
getEventType
in class ServerSentEvent
public java.util.Optional<java.lang.String> getId()
ServerSentEvent
getId
in class ServerSentEvent
public java.util.OptionalInt getRetry()
ServerSentEvent
getRetry
in class ServerSentEvent