public interface Headers extends InboundHeaders, OutboundHeaders
| Modifier and Type | Method and Description |
|---|---|
void |
addHeader(java.lang.String name,
java.lang.String value)
Add a header with the given name and value.
|
boolean |
containsHeader(java.lang.String name)
Return a boolean indicating whether the named header has already been set.
|
java.lang.String |
getHeader(java.lang.String name)
Returns the value of the first specified message header as a
String. |
java.util.Collection<java.lang.String> |
getHeaderNames()
Get the names of the headers.
|
java.util.Collection<java.lang.String> |
getHeaders(java.lang.String name)
Return all the values of the specified message header as a
List of String objects. |
HeaderType |
getHeaderType()
Return the type of header key syntax used for this.
|
void |
setHeader(java.lang.String name,
java.lang.String value)
Set a header with the given name and value.
|
HeaderType getHeaderType()
getHeaderType in interface InboundHeadersgetHeaderType in interface OutboundHeadersenum specifying the type of headers present.java.lang.String getHeader(java.lang.String name)
String. If the message does not include a header
with the specified input name, then this method returns null.getHeader in interface InboundHeadersname - The name of the desired message header.String containing the value of the requested header, or null if the message header is not
present.java.util.Collection<java.lang.String> getHeaders(java.lang.String name)
List of String objects. If the message
does not include any headers of the specified name, this method returns an empty list.
Changes to the returned collection must not affect the Headers instance.
name - The name of the desired message header.List containing the values of the requested header, or an empty list of the message header is not
present.void setHeader(java.lang.String name,
java.lang.String value)
containsHeader(String) can be used to test for the presence of a header before setting its value.setHeader in interface OutboundHeadersname - The name of the header.value - The value of the header.void addHeader(java.lang.String name,
java.lang.String value)
name - The name of the header.value - The value of the header.java.util.Collection<java.lang.String> getHeaderNames()
Changes to the returned collection must not affect the Headers instance.
Collection of the names of present headers.boolean containsHeader(java.lang.String name)
name - The name of the header.true if the header has already been set, false otherwise.