- All Known Subinterfaces:
InboundRequestHeaders
,InboundResponseHeaders
,OutboundHeaders<A>
,OutboundRequestHeaders
,OutboundResponseHeaders
Represents immutable inbound HTTP headers.
- Since:
- 1.6
- Author:
- Jeremy Kuhn
-
Method Summary
Modifier and TypeMethodDescriptionboolean
contains
(CharSequence name) Determines whether a header with the specified name is present.boolean
contains
(CharSequence name, CharSequence value) Determines whether a header with the specified name and value is present.get
(CharSequence name) Returns the value of the header with the specified name.getAll()
Returns all headers specified in the HTTP message.getAll
(CharSequence name) Returns the values of all headers with the specified name.Decodes and returns all headers specified in the HTTP message.getAllHeader
(CharSequence name) Decodes and returns all headers with the specified name.Returns all headers specified in the HTTP message as parameters.getAllParameter
(CharSequence name) Returns all headers with the specified name as parameters.getHeader
(CharSequence name) Decodes and returns the header with the specified name.getNames()
Returns the names of the headers specified in the HTTP message.getParameter
(CharSequence name) Returns the header with the specified name as a parameter.
-
Method Details
-
contains
Determines whether a header with the specified name is present.
- Parameters:
name
- a header name- Returns:
- true if a header is present, false otherwise
-
contains
Determines whether a header with the specified name and value is present.
- Parameters:
name
- a header namevalue
- a header value- Returns:
- true if a header is present, false otherwise
-
getNames
Returns the names of the headers specified in the HTTP message.
- Returns:
- the header names
-
get
Returns the value of the header with the specified name.
If there are multiple headers with the same name, the first one is returned.
- Parameters:
name
- a header name- Returns:
- an optional returning the value of the header or an empty optional if there's no header with the specified name
-
getAll
Returns the values of all headers with the specified name.
- Parameters:
name
- a header name- Returns:
- a list of header values or an empty list if there's no header with the specified name
-
getAll
Returns all headers specified in the HTTP message.
- Returns:
- a list of header entries or an empty list if there's no header
-
getParameter
Returns the header with the specified name as a parameter.
If there are multiple headers with the same name, the first one is returned.
- Parameters:
name
- a header name- Returns:
- an optional returning the parameter or an empty optional if there's no header with the specified name
-
getAllParameter
Returns all headers with the specified name as parameters.
- Parameters:
name
- a header name- Returns:
- a list of parameters or an empty list if there's no header with the specified name
-
getAllParameter
Returns all headers specified in the HTTP message as parameters.
- Returns:
- a list of parameters or an empty list if there's no header
-
getHeader
Decodes and returns the header with the specified name.
If there are multiple headers with the same name, the first one is returned.
- Type Parameters:
T
- the decoded header type- Parameters:
name
- a header name- Returns:
- an optional returning the decoded header or an empty optional if there's no header with the specified name
-
getAllHeader
Decodes and returns all headers with the specified name.
- Type Parameters:
T
- the decoded header type- Parameters:
name
- a header name- Returns:
- a list of header values or an empty list if there's no header with the specified name
-
getAllHeader
Decodes and returns all headers specified in the HTTP message.
- Returns:
- a list of headers or an empty list if there's no header
-