Package org.eclipse.jetty.http
Interface HttpFields
- All Known Implementing Classes:
HttpFields.Immutable
,HttpFields.Mutable
,HttpTester.Message
,HttpTester.Request
,HttpTester.Response
Interface that represents on ordered collection of
HttpField
s.
Both HttpFields.Mutable
and HttpFields.Immutable
implementations are available
via the static methods such as build()
and from(HttpField...)
.-
Nested Class Summary
Modifier and TypeInterfaceDescriptionstatic class
HTTP Fields.static class
HTTP Fields. -
Field Summary
Modifier and TypeFieldDescriptionstatic final HttpFields
A constant for an immutable and emptyHttpFields
. -
Method Summary
Modifier and TypeMethodDescriptiondefault String
asString()
static HttpFields.Mutable
build()
static HttpFields.Mutable
build
(int capacity) static HttpFields.Mutable
build
(HttpFields fields) static HttpFields.Mutable
build
(HttpFields fields, EnumSet<HttpHeader> removeFields) static HttpFields.Mutable
build
(HttpFields fields, HttpField replaceField) default boolean
default boolean
default boolean
contains
(EnumSet<HttpHeader> headers) default boolean
default boolean
contains
(HttpHeader header) default boolean
contains
(HttpHeader header, String value) static HttpFields.Immutable
default String
default String
get
(HttpHeader header) Get multiple field values of the same name as aQuotedCSV
getCSV
(HttpHeader header, boolean keepQuotes) Get multiple field values of the same name, split as aQuotedCSV
default long
getDateField
(String name) Get a header as a date value.getField
(int index) Get a Field by index.default HttpField
default HttpField
getField
(HttpHeader header) default Enumeration<String>
Get enumeration of header _names.Get Set of header names.getFields
(HttpHeader header) Get multiple fields of the same headerdefault long
getLongField
(String name) Get a header as an long value.default long
getLongField
(HttpHeader header) Get a header as an long value.getQualityCSV
(String name) Get multiple field values of the same name, split and sorted as aQuotedQualityCSV
getQualityCSV
(HttpHeader header) Get multiple field values of the same name, split and sorted as aQuotedQualityCSV
getQualityCSV
(HttpHeader header, ToIntFunction<String> secondaryOrdering) Get multiple field values of the same name, split and sorted as aQuotedQualityCSV
default Enumeration<String>
Get multi headersgetValuesList
(String name) Get multiple header of the same namegetValuesList
(HttpHeader header) Get multiple field values of the same namedefault boolean
isEqualTo
(HttpFields that) int
size()
stream()
Methods inherited from interface java.lang.Iterable
forEach, iterator, spliterator
-
Field Details
-
EMPTY
A constant for an immutable and empty
HttpFields
.
-
-
Method Details
-
build
-
build
-
build
-
build
-
build
-
from
-
asImmutable
HttpFields.Immutable asImmutable() -
asString
-
contains
-
contains
-
contains
-
contains
-
contains
-
contains
-
get
-
get
-
getCSV
Get multiple field values of the same name, split as aQuotedCSV
- Parameters:
header
- The headerkeepQuotes
- True if the fields are kept quoted- Returns:
- List the values with OWS stripped
-
getCSV
Get multiple field values of the same name as aQuotedCSV
- Parameters:
name
- the case-insensitive field namekeepQuotes
- True if the fields are kept quoted- Returns:
- List the values with OWS stripped
-
getDateField
Get a header as a date value. Returns the value of a date field, or -1 if not found. The case of the field name is ignored.- Parameters:
name
- the case-insensitive field name- Returns:
- the value of the field as a number of milliseconds since unix epoch
-
getField
Get a Field by index.- Parameters:
index
- the field index- Returns:
- A Field value or null if the Field value has not been set
-
getField
-
getField
-
getFieldNames
Get enumeration of header _names. Returns an enumeration of strings representing the header _names for this request.- Returns:
- an enumeration of field names
-
getFieldNamesCollection
Get Set of header names.- Returns:
- the unique set of field names.
-
getFields
Get multiple fields of the same header- Parameters:
header
- the header- Returns:
- List the fields
-
getFields
-
getLongField
Get a header as an long value. Returns the value of an integer field or -1 if not found. The case of the field name is ignored.- Parameters:
name
- the case-insensitive field name- Returns:
- the value of the field as a long
- Throws:
NumberFormatException
- If bad long found
-
getLongField
Get a header as an long value. Returns the value of an integer field or -1 if not found. The case of the field name is ignored.- Parameters:
header
- the header type- Returns:
- the value of the field as a long
- Throws:
NumberFormatException
- If bad long found
-
getQualityCSV
Get multiple field values of the same name, split and sorted as aQuotedQualityCSV
- Parameters:
header
- The header- Returns:
- List the values in quality order with the q param and OWS stripped
-
getQualityCSV
Get multiple field values of the same name, split and sorted as aQuotedQualityCSV
- Parameters:
header
- The headersecondaryOrdering
- Function to apply an ordering other than specified by quality- Returns:
- List the values in quality order with the q param and OWS stripped
-
getQualityCSV
Get multiple field values of the same name, split and sorted as aQuotedQualityCSV
- Parameters:
name
- the case-insensitive field name- Returns:
- List the values in quality order with the q param and OWS stripped
-
getValues
Get multi headers- Parameters:
name
- the case-insensitive field name- Returns:
- Enumeration of the values
-
getValuesList
Get multiple field values of the same name- Parameters:
header
- the header- Returns:
- List the values
-
getValuesList
Get multiple header of the same name- Parameters:
name
- the case-insensitive field name- Returns:
- List the header values
-
isEqualTo
-
size
int size() -
stream
-