Interface Event<T>
- Type Parameters:
T- The event type
public interface Event<T>
Represents a Server Sent Event. See https://www.w3.org/TR/2011/WD-eventsource-20111020/.
- Since:
- 1.0
- Author:
- Graeme Rocher
-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionSets the event comment.@Nullable StringgetData()@Nullable StringgetId()@Nullable StringgetName()@Nullable DurationgetRetry()Sets the id.Sets the event name.static <ET> Event<ET> of(ET data) Constructs a new event for the given data.static <ET> Event<ET> Constructs a new event for the given data.Sets the retry duration.
-
Field Details
-
ID
-
EVENT
-
DATA
-
RETRY
-
-
Method Details
-
getData
T getData()- Returns:
- The data object to write
-
getId
@Nullable String getId()- Returns:
- The ID of the event, or null if there is no ID
-
getName
@Nullable String getName()- Returns:
- The name of the event
-
getComment
@Nullable String getComment()- Returns:
- A comment for the event, or null if there is no comment
-
getRetry
@Nullable Duration getRetry()- Returns:
- The duration to retry
-
retry
-
id
-
name
-
comment
-
of
Constructs a new event for the given data.- Type Parameters:
ET- The data type- Parameters:
data- The data- Returns:
- The event instance
-
of
-