Package play.libs
Class EventSource.Event
java.lang.Object
play.libs.EventSource.Event
- Enclosing class:
- EventSource
Utility class to build events.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic EventSource.Eventevent(com.fasterxml.jackson.databind.JsonNode json) static EventSource.Event
-
Constructor Details
-
Event
-
-
Method Details
-
withName
- Parameters:
name- Event name- Returns:
- A copy of this event, with name
name
-
withId
- Parameters:
id- Event id- Returns:
- A copy of this event, with id
id.
-
formatted
- Returns:
- This event formatted according to the EventSource protocol.
-
event
- Parameters:
data- Event content- Returns:
- An event with
dataas content
-
event
- Parameters:
json- Json value to use- Returns:
- An event with a string representation of
jsonas content
-