public abstract class MessageHeader extends Object
Modifier and Type | Method and Description |
---|---|
Optional<String> |
getHeader(String name)
Get the header with the given name.
|
org.pcollections.PMap<String,org.pcollections.PSequence<String>> |
headers()
Get the headers for the message.
|
MessageProtocol |
protocol()
Get the protocol of the message.
|
abstract MessageHeader |
replaceAllHeaders(org.pcollections.PMap<String,org.pcollections.PSequence<String>> headers)
Return a copy of this message header with the headers replaced by the given map of headers.
|
abstract MessageHeader |
withHeader(String name,
String value)
Return a copy of this message header with the given header added to the map of headers.
|
abstract MessageHeader |
withProtocol(MessageProtocol protocol)
Return a copy of this message header with the given protocol.
|
public MessageProtocol protocol()
public org.pcollections.PMap<String,org.pcollections.PSequence<String>> headers()
The returned map is case sensitive, it is recommended that you use getHeader instead.
public Optional<String> getHeader(String name)
The lookup is case insensitive.
name
- The name of the header.public abstract MessageHeader withProtocol(MessageProtocol protocol)
protocol
- The protocol to set.public abstract MessageHeader replaceAllHeaders(org.pcollections.PMap<String,org.pcollections.PSequence<String>> headers)
headers
- The map of headers.public abstract MessageHeader withHeader(String name, String value)
If the header already has a value, this value will replace it.
name
- The name of the header to add.value
- The value of the header to add.