Class HttpFields.ImmutableHttpFields
- All Implemented Interfaces:
Iterable<HttpField>
,Supplier<HttpFields>
,HttpFields
- Enclosing interface:
- HttpFields
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.eclipse.jetty.http.HttpFields
HttpFields.ImmutableHttpFields, HttpFields.Mutable, HttpFields.MutableHttpFields
-
Field Summary
Fields inherited from interface org.eclipse.jetty.http.HttpFields
CONNECTION_CLOSE, CONNECTION_KEEPALIVE, CONTENT_LENGTH_0, EMPTY, EXPIRES_01JAN1970
-
Constructor Summary
ModifierConstructorDescriptionprotected
ImmutableHttpFields
(HttpField[] fields, int size) Deprecated, for removal: This API element is subject to removal in a future version. -
Method Summary
Modifier and TypeMethodDescriptionReturns an immutable copy of thisHttpFields
instance.boolean
Returns the encoded value of the first field with the given field name, ornull
if no such field is present.get
(HttpHeader header) Returns the encoded value of the first field with the given field name, ornull
if no such header is present.getField
(int index) Returns the firstHttpField
with the given field name, ornull
if no such field is present.getField
(HttpHeader header) Returns the firstHttpField
with the given field name, ornull
if no such field is present.int
hashCode()
listIterator
(int index) int
size()
stream()
toString()
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface org.eclipse.jetty.http.HttpFields
asString, contains, contains, contains, contains, contains, contains, containsLast, get, getCSV, getCSV, getDateField, getDateField, getFieldNames, getFieldNamesCollection, getFields, getFields, getLast, getLongField, getLongField, getQualityCSV, getQualityCSV, getQualityCSV, getValues, getValuesList, getValuesList, isEqualTo, iterator, listIterator
Methods inherited from interface java.lang.Iterable
forEach, spliterator
-
Constructor Details
-
ImmutableHttpFields
Deprecated, for removal: This API element is subject to removal in a future version.
-
-
Method Details
-
asImmutable
Description copied from interface:HttpFields
Returns an immutable copy of this
HttpFields
instance.- Specified by:
asImmutable
in interfaceHttpFields
- Returns:
- a new immutable copy of this
HttpFields
instance
-
hashCode
public int hashCode() -
equals
-
get
Description copied from interface:HttpFields
Returns the encoded value of the first field with the given field name, or
null
if no such field is present.The comparison of field name is case-insensitive via
HttpField.is(String)
. If possible, it is more efficient to useHttpFields.get(HttpHeader)
.In case of multi-valued fields, the returned value is the encoded value, including commas and quotes, as returned by
HttpField.getValue()
.- Specified by:
get
in interfaceHttpFields
- Parameters:
name
- the case-insensitive field name to search for- Returns:
- the raw value of the first field with the given field name,
or
null
if no such field is present - See Also:
-
get
Description copied from interface:HttpFields
Returns the encoded value of the first field with the given field name, or
null
if no such header is present.In case of multi-valued fields, the returned value is the encoded value, including commas and quotes, as returned by
HttpField.getValue()
.- Specified by:
get
in interfaceHttpFields
- Parameters:
header
- the field name to search for- Returns:
- the raw value of the first field with the given field name,
or
null
if no such header is present - See Also:
-
getField
Description copied from interface:HttpFields
Returns the first
HttpField
with the given field name, ornull
if no such field is present.- Specified by:
getField
in interfaceHttpFields
- Parameters:
header
- the field name to search for- Returns:
- the first
HttpField
with the given field name, ornull
if no such field is present
-
getField
Description copied from interface:HttpFields
Returns the first
HttpField
with the given field name, ornull
if no such field is present.The comparison of field name is case-insensitive via
HttpField.is(String)
.- Specified by:
getField
in interfaceHttpFields
- Parameters:
name
- the case-insensitive field name to search for- Returns:
- the first
HttpField
with the given field name, ornull
if no such field is present
-
getField
Description copied from interface:HttpFields
Returns the
HttpField
at the givenindex
, ornull
if there is no field at the given index.- Specified by:
getField
in interfaceHttpFields
- Parameters:
index
- the index of theHttpField
- Returns:
- the
HttpField
at the givenindex
, ornull
if there is no field at the given index
-
listIterator
- Specified by:
listIterator
in interfaceHttpFields
- Returns:
- an iterator over the
HttpField
s in thisHttpFields
starting at the given index. - See Also:
-
size
public int size()- Specified by:
size
in interfaceHttpFields
- Returns:
- the number of
HttpField
s in this instance
-
stream
- Specified by:
stream
in interfaceHttpFields
- Returns:
- a sequential stream of the
HttpField
s in this instance
-
toString
-