public static final class ServerSentEvent.Builder extends Object
ServerSentEvent.
Initialize attributes and then invoke the build() method to create an
immutable instance.
Builder is not thread-safe and generally should not be stored in a field or collection,
but instead used immediately to create instances.
| Modifier and Type | Method and Description |
|---|---|
ServerSentEvent |
build()
Builds a new
ServerSentEvent. |
ServerSentEvent.Builder |
data(String data)
Initializes the value for the
data attribute. |
ServerSentEvent.Builder |
eventType(String eventType)
Initializes the value for the
eventType attribute. |
ServerSentEvent.Builder |
from(ServerSentEvent instance)
Fill a builder with attribute values from the provided
ServerSentEvent instance. |
ServerSentEvent.Builder |
id(String id)
Initializes the value for the
id attribute. |
ServerSentEvent.Builder |
retry(Integer retry)
Initializes the value for the
retry attribute. |
public final ServerSentEvent.Builder from(ServerSentEvent instance)
ServerSentEvent instance.
Regular attribute values will be replaced with those from the given instance.
Absent optional values will not replace present values.instance - The instance from which to copy valuesthis builder for use in a chained invocationpublic final ServerSentEvent.Builder data(String data)
data attribute.data - The value for data (can be null)this builder for use in a chained invocationpublic final ServerSentEvent.Builder eventType(String eventType)
eventType attribute.eventType - The value for eventType (can be null)this builder for use in a chained invocationpublic final ServerSentEvent.Builder id(String id)
id attribute.id - The value for id (can be null)this builder for use in a chained invocationpublic final ServerSentEvent.Builder retry(Integer retry)
retry attribute.retry - The value for retry (can be null)this builder for use in a chained invocationpublic ServerSentEvent build()
ServerSentEvent.IllegalStateException - if any required attributes are missingCopyright © 2017 Pivotal Software, Inc.. All rights reserved.