Package org.eclipse.jetty.http
Class HttpFields.Mutable.Wrapper
java.lang.Object
org.eclipse.jetty.http.HttpFields.Mutable.Wrapper
- All Implemented Interfaces:
Iterable<HttpField>
,Supplier<HttpFields>
,HttpFields
,HttpFields.Mutable
- Direct Known Subclasses:
WebSocketHttpFieldsWrapper
- Enclosing interface:
- HttpFields.Mutable
A wrapper of
HttpFields
instances.-
Nested Class Summary
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.clear()
Removes all the fields from this instance.listIterator
(int index) onAddField
(HttpField field) Called when a field is added (including as part of a put).boolean
onRemoveField
(HttpField field) Called when a field is removed (including as part of a put).onReplaceField
(HttpField oldField, HttpField newField) Puts the givenHttpField
into this instance.int
size()
stream()
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.eclipse.jetty.http.HttpFields
asImmutable, asString, contains, contains, contains, contains, contains, contains, containsLast, get, get, get, getCSV, getCSV, getDateField, getDateField, getField, getField, getField, getFieldNames, getFieldNamesCollection, getFields, getFields, getLast, getLongField, getLongField, getQualityCSV, getQualityCSV, getQualityCSV, getValues, getValuesList, getValuesList, isEqualTo, iterator, listIterator
Methods inherited from interface org.eclipse.jetty.http.HttpFields.Mutable
add, add, add, add, add, add, add, addCSV, addCSV, addDateField, computeField, computeField, ensureField, put, put, put, put, put, put, putDate, putDate, remove, remove, remove
Methods inherited from interface java.lang.Iterable
forEach, spliterator
-
Constructor Details
-
Wrapper
-
-
Method Details
-
onAddField
Called when a field is added (including as part of a put).- Parameters:
field
- The field being added.- Returns:
- The field to add, or null if the add is to be ignored.
-
onRemoveField
Called when a field is removed (including as part of a put).- Parameters:
field
- The field being removed.- Returns:
- True if the field should be removed, false otherwise.
-
onReplaceField
-
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
-
put
Description copied from interface:HttpFields.Mutable
Puts the given
HttpField
into this instance.If a fields with the same name is present, the given field replaces it, and other existing fields with the same name are removed, so that only the given field will be present.
If a field with the same name is not present, the given field will be added.
- Specified by:
put
in interfaceHttpFields.Mutable
- Parameters:
field
- the field to put- Returns:
- this instance
-
clear
Description copied from interface:HttpFields.Mutable
Removes all the fields from this instance.
- Specified by:
clear
in interfaceHttpFields.Mutable
- Returns:
- this instance
-
listIterator
- Specified by:
listIterator
in interfaceHttpFields
- Returns:
- an iterator over the
HttpField
s in thisHttpFields
starting at the given index. - See Also:
-