public static class OutboundEvent.Builder extends Object
OutboundEvent instances.| Constructor and Description |
|---|
OutboundEvent.Builder() |
| Modifier and Type | Method and Description |
|---|---|
OutboundEvent |
build()
Build
OutboundEvent. |
OutboundEvent.Builder |
comment(String comment)
Set comment.
|
OutboundEvent.Builder |
data(Class type,
Object data)
Set event data and java type of event data.
|
OutboundEvent.Builder |
id(String id)
Set event id.
|
OutboundEvent.Builder |
mediaType(MediaType mediaType)
Set
MediaType of event data. |
OutboundEvent.Builder |
name(String name)
Set event name.
|
public OutboundEvent.Builder name(String name)
name - field name "event" value.public OutboundEvent.Builder id(String id)
id - event id.public OutboundEvent.Builder mediaType(MediaType mediaType)
MediaType of event data.
When it is set, it will be used for MessageBodyWriter lookup. Default value is
MediaType.TEXT_PLAIN.
mediaType - MediaType of event data.public OutboundEvent.Builder comment(String comment)
comment - comment string.public OutboundEvent.Builder data(Class type, Object data)
MessageBodyWriter
lookup.type - java type of supplied data. MUST NOT be null.data - event data. MUST NOT be null.public OutboundEvent build() throws IllegalStateException
OutboundEvent.
There are two valid configurations:
comment is set, all other parameters are optional. If data(Class, Object)
and type is set, event will be serialized after comment.comment is not set, data(Class, Object) and type HAVE TO
be set, all other parameters are optional.OutboundEvent instance.IllegalStateException - when called with invalid configuration.Copyright © 2007-2012 Oracle Corporation. All Rights Reserved. Use is subject to license terms.