public static class Event.Headers
extends java.lang.Object
implements java.io.Serializable, java.lang.Iterable<reactor.fn.tuple.Tuple2<java.lang.String,java.lang.Object>>
String.CASE_INSENSITIVE_ORDER. A header can be removed by setting its value to null.| Modifier and Type | Field and Description |
|---|---|
static java.lang.String |
ORIGIN
The name of the origin header
|
| Constructor and Description |
|---|
Headers()
Create an empty Headers
|
Headers(java.util.Map<java.lang.String,java.lang.Object> headers)
Creates a new Headers instance by copying the contents of the given
headers Map. |
| Modifier and Type | Method and Description |
|---|---|
java.util.Map<java.lang.String,java.lang.Object> |
asMap()
Get these headers as an unmodifiable
Map. |
boolean |
contains(java.lang.String name)
Determine whether the headers contain a value for the given name.
|
<V> V |
get(java.lang.String name)
Get the value for the given header.
|
java.lang.String |
getOrigin()
Get the origin header
|
java.util.Iterator<reactor.fn.tuple.Tuple2<java.lang.String,java.lang.Object>> |
iterator()
Returns an unmodifiable Iterator over a copy of this Headers' contents.
|
Event.Headers |
readOnly()
Get the headers as a read-only version
|
<V> Event.Headers |
set(java.lang.String name,
V value)
Set the header value.
|
Event.Headers |
setAll(java.util.Map<java.lang.String,java.lang.Object> headers)
Sets all of the headers represented by entries in the given
headers Map. |
Event.Headers |
setOrigin(java.lang.String id)
Set the origin header.
|
Event.Headers |
setOrigin(java.util.UUID id)
Set the origin header.
|
java.lang.String |
toString() |
public static final java.lang.String ORIGIN
setOrigin(String),
setOrigin(UUID),
getOrigin(),
Constant Field Valuespublic Headers(java.util.Map<java.lang.String,java.lang.Object> headers)
headers Map. Note that, as the map is
copied, subsequent changes to its contents will have no effect upon the Headers.headers - The map to copy.public Headers()
public Event.Headers setAll(java.util.Map<java.lang.String,java.lang.Object> headers)
headers Map. Any entry with a null value will
cause the header matching the entry's name to be removed.headers - The map of headers to set.thispublic <V> Event.Headers set(java.lang.String name, V value)
value is null the header with the given name will be removed.name - The name of the header.value - The header's value.thispublic Event.Headers setOrigin(java.util.UUID id)
id is null the origin header will be removed.id - The id of the origin component.thispublic java.lang.String getOrigin()
null.public Event.Headers setOrigin(java.lang.String id)
id is null this origin header will be removed.id - The id of the origin component.thispublic <V> V get(java.lang.String name)
name - The header name.null if none exists.public boolean contains(java.lang.String name)
name - The header name.true if a value exists, false otherwise.public java.util.Map<java.lang.String,java.lang.Object> asMap()
Map.public Event.Headers readOnly()
public java.util.Iterator<reactor.fn.tuple.Tuple2<java.lang.String,java.lang.Object>> iterator()
iterator in interface java.lang.Iterable<reactor.fn.tuple.Tuple2<java.lang.String,java.lang.Object>>public java.lang.String toString()
toString in class java.lang.Object