Constructor and Description |
---|
Headers(Header... headers) |
Headers(List<Header> headers) |
Modifier and Type | Method and Description |
---|---|
List<Header> |
asList() |
boolean |
exist() |
Header |
get(String headerName)
Get a single header with the supplied name.
|
List<Header> |
getList(String headerName)
Get all headers with the supplied name.
|
String |
getValue(String headerName)
Get a single header with the supplied name.
|
List<String> |
getValues(String headerName)
Get all header values of the header with supplied name.
|
boolean |
hasHeaderWithName(String headerName)
See if a header with the given name exists
|
static Headers |
headers(Header header,
Header... additionalHeaders)
An alternative way to create a Headers object from the constructor.
|
Iterator<Header> |
iterator() |
protected List<Header> |
list() |
int |
size() |
String |
toString() |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
forEach, spliterator
public Headers(Header... headers)
public int size()
public boolean exist()
true
if one or more headers are defined, false
otherwise.public boolean hasHeaderWithName(String headerName)
headerName
- The name of the header to checktrue
if the header existspublic Header get(String headerName)
headerName
then
the last one is returned.headerName
- The name of the header to findnull
if no header was found.public String getValue(String headerName)
headerName
then
the last one is returned.headerName
- The name of the header to findnull
if no header was found.public List<String> getValues(String headerName)
headerName
then
a list with only that header value is returned.headerName
- The name of the header to findpublic List<Header> getList(String headerName)
headerName
then
a list with only that header is returned.headerName
- The name of the header to findpublic static Headers headers(Header header, Header... additionalHeaders)
header
- The header to be includedadditionalHeaders
- Additional headers to be included (optional)Copyright © 2010–2020. All rights reserved.