Class ResponseHttpFields
java.lang.Object
org.eclipse.jetty.server.internal.ResponseHttpFields
- All Implemented Interfaces:
Iterable<HttpField>,Supplier<HttpFields>,HttpFields,HttpFields.Mutable
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic interfaceA marker interface forHttpFields that cannot beremovedorclearedfrom aResponseHttpFieldsinstance.static classAHttpFieldthat is aResponseHttpFields.Persistent.static classAPreEncodedHttpFieldthat is aResponseHttpFields.Persistent.Nested classes/interfaces inherited from interface org.eclipse.jetty.http.HttpFields
HttpFields.ImmutableHttpFields, HttpFields.Mutable, HttpFields.MutableHttpFieldsNested 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
Constructors -
Method Summary
Modifier and TypeMethodDescriptionAdds the givenHttpFieldto this instance.Returns an immutable copy of thisHttpFieldsinstance.clear()Removes all the fields from this instance.booleancommit()voidensureField(HttpField field) Ensures that the givenHttpFieldis present when the field may not exist or may exist and be multi-valued.getField(int index) Returns the firstHttpFieldwith the given field name, ornullif no such field is present.getField(HttpHeader header) Returns the firstHttpFieldwith the given field name, ornullif no such field is present.booleaniterator()listIterator(int index) voidrecycle()intsize()stream()toString()Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods 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, listIteratorMethods 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, removeMethods 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:HttpFieldsReturns the first
HttpFieldwith the given field name, ornullif no such field is present.The comparison of field name is case-insensitive via
HttpField.is(String).- Specified by:
getFieldin interfaceHttpFields- Parameters:
name- the case-insensitive field name to search for- Returns:
- the first
HttpFieldwith the given field name, ornullif no such field is present
-
getField
Description copied from interface:HttpFieldsReturns the first
HttpFieldwith the given field name, ornullif no such field is present.- Specified by:
getFieldin interfaceHttpFields- Parameters:
header- the field name to search for- Returns:
- the first
HttpFieldwith the given field name, ornullif no such field is present
-
getField
Description copied from interface:HttpFieldsReturns the
HttpFieldat the givenindex, ornullif there is no field at the given index.- Specified by:
getFieldin interfaceHttpFields- Parameters:
index- the index of theHttpField- Returns:
- the
HttpFieldat the givenindex, ornullif there is no field at the given index
-
size
public int size()- Specified by:
sizein interfaceHttpFields- Returns:
- the number of
HttpFields in this instance
-
stream
- Specified by:
streamin interfaceHttpFields- Returns:
- a sequential stream of the
HttpFields in this instance
-
add
Description copied from interface:HttpFields.MutableAdds the given
HttpFieldto this instance.- Specified by:
addin interfaceHttpFields.Mutable- Parameters:
field- theHttpFieldto add- Returns:
- this instance
-
asImmutable
Description copied from interface:HttpFieldsReturns an immutable copy of this
HttpFieldsinstance.- Specified by:
asImmutablein interfaceHttpFields- Returns:
- a new immutable copy of this
HttpFieldsinstance
-
clear
Description copied from interface:HttpFields.MutableRemoves all the fields from this instance.
- Specified by:
clearin interfaceHttpFields.Mutable- Returns:
- this instance
-
ensureField
Description copied from interface:HttpFields.MutableEnsures that the given
HttpFieldis present when the field may not exist or may exist and be multi-valued.Multiple existing
HttpFields are merged into a single field.- Specified by:
ensureFieldin interfaceHttpFields.Mutable- Parameters:
field- the field to ensure to be present
-
iterator
-
listIterator
- Specified by:
listIteratorin interfaceHttpFields- Returns:
- an iterator over the
HttpFields in thisHttpFieldsstarting at the given index. - See Also:
-
toString
-