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 values.-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic interfaceConvenience class for constructing and manipulatingRequestHeaderContainers. -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final RequestHeaderContainerAn emptyRequestHeaderContainer. -
Method Summary
Modifier and TypeMethodDescriptionbooleancontainsHeader(String headerName) Determines whether an HTTP header with the givenheaderNameexists 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.Builderby 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, andheaderawill 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
Listof contained HTTP header names.
-
containsHeader
Determines whether an HTTP header with the givenheaderNameexists in this container. TheheaderNameis treated case insensitively.- Parameters:
headerName- The name of the HTTP header to look for.- Returns:
trueif an HTTP header with the given name is contained,falseotherwise.
-
getHeaderValues
Returns a non-unique collection of individual values for an HTTP header with the givenheaderName. TheheaderNameis treated case insensitively.- Parameters:
headerName- The name of the HTTP header to retrieve the values for.- Returns:
- An immutable
Listof individual HTTP header values.
-
toBuilder
Initializes a new instance ofRequestHeaderContainer.Builderby copying all HTTP headers that are contained in thisRequestHeaderContainer.- Returns:
- A new instance of
RequestHeaderContainer.Builder.
-