Modifier and Type | Method | Description |
---|---|---|
Headers |
add(java.lang.String key,
byte[] value) |
Creates and adds a header, to the end, returning if the operation succeeded.
|
Headers |
add(Header header) |
Adds a header (key inside), to the end, returning if the operation succeeded.
|
java.lang.Iterable<Header> |
headers(java.lang.String key) |
Returns all headers for the given key, in the order they were added in, if present.
|
Header |
lastHeader(java.lang.String key) |
Returns just one (the very last) header for the given key, if present.
|
Headers |
remove(java.lang.String key) |
Removes all headers for the given key returning if the operation succeeded.
|
Header[] |
toArray() |
Returns all headers as an array, in the order they were added in.
|
Headers add(Header header) throws java.lang.IllegalStateException
header
- the Header to be addedjava.lang.IllegalStateException
- is thrown if headers are in a read-only state.Headers add(java.lang.String key, byte[] value) throws java.lang.IllegalStateException
key
- of the header to be added.value
- of the header to be added.java.lang.IllegalStateException
- is thrown if headers are in a read-only state.Headers remove(java.lang.String key) throws java.lang.IllegalStateException
key
- to remove all headers for.java.lang.IllegalStateException
- is thrown if headers are in a read-only state.Header lastHeader(java.lang.String key)
key
- to get the last header for.java.lang.Iterable<Header> headers(java.lang.String key)
key
- to return the headers for.Header[] toArray()