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