Interface RequestHeaderContainer
- All Known Implementing Classes:
DefaultRequestHeaderContainer
public interface RequestHeaderContainer
Represents an immutable container for multiple HTTP headers. These headers consist of a
name
and
multiple value
s.-
Nested Class Summary
Modifier and TypeInterfaceDescriptionstatic interface
Convenience class for constructing and manipulatingRequestHeaderContainer
s. -
Field Summary
Modifier and TypeFieldDescriptionstatic final RequestHeaderContainer
An emptyRequestHeaderContainer
. -
Method Summary
Modifier and TypeMethodDescriptionboolean
containsHeader
(String headerName) Determines whether an HTTP header with the givenheaderName
exists in this container.Returns all unique names of the contained HTTP headers.getHeaderValues
(String headerName) Returns a non-unique collection of individual values for an HTTP header with the givenheaderName
.Initializes a new instance ofRequestHeaderContainer.Builder
by copying all HTTP headers that are contained in thisRequestHeaderContainer
.
-
Field Details
-
EMPTY
An emptyRequestHeaderContainer
.
-
-
Method Details
-
getHeaderNames
Returns all unique names of the contained HTTP headers.Important: Casing of the individual names might be changed by the implementation. Duplicated names that differ only in their casing will be treated as a single name.
Example: The header names
HeaderA
,HEADERA
, andheadera
will result in only a single value being returned from this method.Note: Do not assume any specific casing of the returned header names. Also, do not use this method for determining whether a specific header is contained in this collection. Use
containsHeader(String)
instead.- Returns:
- An immutable
List
of contained HTTP header names.
-
containsHeader
Determines whether an HTTP header with the givenheaderName
exists in this container. TheheaderName
is treated case insensitively.- Parameters:
headerName
- The name of the HTTP header to look for.- Returns:
true
if an HTTP header with the given name is contained,false
otherwise.
-
getHeaderValues
Returns a non-unique collection of individual values for an HTTP header with the givenheaderName
. TheheaderName
is treated case insensitively.- Parameters:
headerName
- The name of the HTTP header to retrieve the values for.- Returns:
- An immutable
List
of individual HTTP header values.
-
toBuilder
Initializes a new instance ofRequestHeaderContainer.Builder
by copying all HTTP headers that are contained in thisRequestHeaderContainer
.- Returns:
- A new instance of
RequestHeaderContainer.Builder
.
-