Class ResponseHttpFields
java.lang.Object
org.eclipse.jetty.server.internal.ResponseHttpFields
- All Implemented Interfaces:
Iterable<HttpField>
,Supplier<HttpFields>
,HttpFields
,HttpFields.Mutable
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic interface
A marker interface forHttpField
s that cannot beremoved
orcleared
from aResponseHttpFields
instance.static class
AHttpField
that is aResponseHttpFields.Persistent
.static class
APreEncodedHttpField
that is aResponseHttpFields.Persistent
.Nested classes/interfaces inherited from interface org.eclipse.jetty.http.HttpFields
HttpFields.ImmutableHttpFields, HttpFields.Mutable, HttpFields.MutableHttpFields
Nested classes/interfaces inherited from interface org.eclipse.jetty.http.HttpFields.Mutable
HttpFields.Mutable.Wrapper
-
Field Summary
Fields inherited from interface org.eclipse.jetty.http.HttpFields
CONNECTION_CLOSE, CONNECTION_KEEPALIVE, CONTENT_LENGTH_0, EMPTY, EXPIRES_01JAN1970
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionAdds the givenHttpField
to this instance.Returns an immutable copy of thisHttpFields
instance.clear()
Removes all the fields from this instance.boolean
commit()
void
ensureField
(HttpField field) Ensures that the givenHttpField
is present when the field may not exist or may exist and be multi-valued.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.boolean
iterator()
listIterator
(int index) void
recycle()
int
size()
stream()
toString()
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface org.eclipse.jetty.http.HttpFields
asString, contains, contains, contains, contains, contains, contains, containsLast, get, get, get, getCSV, getCSV, getDateField, getDateField, getFieldNames, getFieldNamesCollection, getFields, getFields, getLast, getLongField, getLongField, getQualityCSV, getQualityCSV, getQualityCSV, getValues, getValuesList, getValuesList, isEqualTo, listIterator
Methods inherited from interface org.eclipse.jetty.http.HttpFields.Mutable
add, add, add, add, add, add, add, addCSV, addCSV, addDateField, computeField, computeField, put, put, put, put, put, put, put, putDate, putDate, remove, remove, remove
Methods inherited from interface java.lang.Iterable
forEach, spliterator
-
Constructor Details
-
ResponseHttpFields
public ResponseHttpFields()
-
-
Method Details
-
getMutableHttpFields
-
commit
public boolean commit() -
isCommitted
public boolean isCommitted() -
recycle
public void recycle() -
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 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
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
-
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
-
add
Description copied from interface:HttpFields.Mutable
Adds the given
HttpField
to this instance.- Specified by:
add
in interfaceHttpFields.Mutable
- Parameters:
field
- theHttpField
to add- Returns:
- this instance
-
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
-
clear
Description copied from interface:HttpFields.Mutable
Removes all the fields from this instance.
- Specified by:
clear
in interfaceHttpFields.Mutable
- Returns:
- this instance
-
ensureField
Description copied from interface:HttpFields.Mutable
Ensures that the given
HttpField
is present when the field may not exist or may exist and be multi-valued.Multiple existing
HttpField
s are merged into a single field.- Specified by:
ensureField
in interfaceHttpFields.Mutable
- Parameters:
field
- the field to ensure to be present
-
iterator
- Specified by:
iterator
in interfaceHttpFields
- Specified by:
iterator
in interfaceIterable<HttpField>
-
listIterator
- Specified by:
listIterator
in interfaceHttpFields
- Returns:
- an iterator over the
HttpField
s in thisHttpFields
starting at the given index. - See Also:
-
toString
-