This class is not synchronized as it is expected that modifications will only be performed by a single thread.
The cookie handling provided by this class is guided by the Servlet specification and RFC6265.
| Modifier and Type | Class and Description |
|---|---|
| private class |
| Modifier and Type | Field and Description |
|---|---|
| private HttpField[] | |
| private boolean | |
| private int | |
| private static final int | |
| private static final int |
| Access | Constructor and Description |
|---|---|
| protected | |
| protected | |
| protected | |
| protected | MutableHttpFields(HttpFields
the fields to copy data from fields, HttpField the replacement field replaceField)Initialize HttpFields from another and replace a field |
| protected | MutableHttpFields(HttpFields
the fields to copy data from fields, EnumSet<HttpHeader> the the fields to remove removeFields)Initialize HttpFields from another and remove fields |
| Modifier and Type | Method and Description |
|---|---|
| public HttpFields. | add(HttpField
the field)HttpField to addOverrides default org. Adds the given |
| public HttpFields. | add(HttpFields
the fields to add fields)Overrides default org. Adds all the |
| public HttpFields | asImmutable()
Overrides default org. Returns an immutable copy of this |
| public HttpFields. | clear()
Overrides default org. Removes all the fields from this instance. |
| public HttpFields. | computeField(HttpHeader
the field name header, BiFunction<HttpHeader, List<HttpField>, HttpField> the compute function computeFn)Overrides default org. Computes a single field for the given |
| public HttpFields. | computeField(String
the field name name, BiFunction<String, List<HttpField>, HttpField> the compute function computeFn)Overrides default org. Computes a single field for the given HTTP field name and for existing fields with the same name. |
| public <T> HttpFields. | computeField(T header, BiFunction<T, List<HttpField>, HttpField> computeFn, BiPredicate<HttpField, T> matcher)
|
| private void | |
| public boolean | equals(Object
the reference object with which to compare. o)Overrides java. |
| public HttpField | Returns: A Field value or null if the Field value has not been setthe field index index)Overrides default org. |
| public HttpField | getField(HttpHeader
the field name to search for header)Overrides default org. Returns the first |
| public HttpField | getField(String
the case-insensitive field name to search for name)Overrides default org. Returns the first |
| public int | |
| public Iterator | iterator()
Overrides default org. T.
|
| public ListIterator | |
| public ListIterator | |
| public HttpFields. | put(HttpField
the field to put field)Overrides default org. Puts the given |
| public HttpFields. | put(String
the name of the field name, String the value of the field; if value)null the field is removedOverrides default org. This method behaves like |
| public HttpFields. | put(HttpHeader
the name of the field header, HttpHeaderValue the value of the field; if value)null the field is removedOverrides default org. This method behaves like |
| public HttpFields. | put(HttpHeader
the name of the field header, String the value of the field; if value)null the field is removedOverrides default org. This method behaves like |
| public HttpFields. | remove(HttpHeader
the name of the fields to remove name)Overrides default org. Removes all the fields with the given name. |
| public HttpFields. | remove(EnumSet<HttpHeader>
the names of the fields to remove headers)Overrides default org. Removes all the fields with the given names. |
| public HttpFields. | remove(String
the name of the fields to remove name)Overrides default org. Removes all the fields with the given name. |
| private void | |
| public int | |
| public Stream | |
| public String |
| _fields | back to summary |
|---|---|
| private HttpField[] _fields | |
| _immutable | back to summary |
|---|---|
| private boolean _immutable | |
| _size | back to summary |
|---|---|
| private int _size | |
| INITIAL_SIZE | back to summary |
|---|---|
| private static final int INITIAL_SIZE | |
| SIZE_INCREMENT | back to summary |
|---|---|
| private static final int SIZE_INCREMENT | |
| MutableHttpFields | back to summary |
|---|---|
| protected MutableHttpFields() Initialize an empty HttpFields. | |
| MutableHttpFields | back to summary |
|---|---|
| protected MutableHttpFields(int capacity) Initialize an empty HttpFields.
| |
| MutableHttpFields | back to summary |
|---|---|
| protected MutableHttpFields(HttpFields fields) Initialize HttpFields from another.
| |
| MutableHttpFields | back to summary |
|---|---|
| protected MutableHttpFields(HttpFields fields, HttpField replaceField) Initialize HttpFields from another and replace a field
| |
| MutableHttpFields | back to summary |
|---|---|
| protected MutableHttpFields(HttpFields fields, EnumSet<HttpHeader> removeFields) Initialize HttpFields from another and remove fields
| |
| add | back to summary |
|---|---|
| public HttpFields. Overrides default org. Doc from org. Adds the given
| |
| add | back to summary |
|---|---|
| public HttpFields. Overrides default org. Doc from org. Adds all the
| |
| asImmutable | back to summary |
|---|---|
| public HttpFields asImmutable() Overrides default org. Doc from org. Returns an immutable copy of this
| |
| clear | back to summary |
|---|---|
| public HttpFields. Overrides default org. Doc from org. Removes all the fields from this instance.
| |
| computeField | back to summary |
|---|---|
| public HttpFields. Overrides default org. Doc from org. Computes a single field for the given The compute function receives the field name and a list of fields with the same name
so that their values can be used to compute the value of the field that is returned
by the compute function parameter.
If the compute function returns This method comes handy when you want to add an HTTP header if it does not exist,
or add a value if the HTTP header already exists, similarly to
This method can be used to
This method can be used to coalesce many fields into one:
This method can be used to replace a field:
This method can be used to remove a field:
| |
| computeField | back to summary |
|---|---|
| public HttpFields. Overrides default org. Doc from org. Computes a single field for the given HTTP field name and for existing fields with the same name.
| |
| computeField | back to summary |
|---|---|
| public <T> HttpFields. | |
| copyImmutable | back to summary |
|---|---|
| private void copyImmutable() | |
| equals | back to summary |
|---|---|
| public boolean equals(Object o) Overrides java. Doc from java. Indicates whether some other object is "equal to" this one.
The
An equivalence relation partitions the elements it operates on into equivalence classes; all the members of an equivalence class are equal to each other. Members of an equivalence class are substitutable for each other, at least for some purposes. | |
| getField | back to summary |
|---|---|
| public HttpField getField(int index) Overrides default org. Get a Field by index. | |
| getField | back to summary |
|---|---|
| public HttpField getField(HttpHeader header) Overrides default org. Doc from org. Returns the first
| |
| getField | back to summary |
|---|---|
| public HttpField getField(String name) Overrides default org. Doc from org. Returns the first The comparison of field name is case-insensitive via
| |
| hashCode | back to summary |
|---|---|
| public int hashCode() Overrides java. Doc from java. Returns a hash code value for the object. This method is
supported for the benefit of hash tables such as those provided by
The general contract of
| |
| iterator | back to summary |
|---|---|
| public Iterator Overrides default org. Doc from java. Returns an iterator over elements of type | |
| listIterator | back to summary |
|---|---|
| public ListIterator Overrides default org.
| |
| listIterator | back to summary |
|---|---|
| public ListIterator Implements org.
| |
| put | back to summary |
|---|---|
| public HttpFields. Overrides default org. Doc from org. Puts the given 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.
| |
| put | back to summary |
|---|---|
| public HttpFields. Overrides default org. Doc from org. This method behaves like
| |
| put | back to summary |
|---|---|
| public HttpFields. Overrides default org. Doc from org. This method behaves like
| |
| put | back to summary |
|---|---|
| public HttpFields. Overrides default org. Doc from org. This method behaves like
| |
| remove | back to summary |
|---|---|
| public HttpFields. Overrides default org. Doc from org. Removes all the fields with the given name.
| |
| remove | back to summary |
|---|---|
| public HttpFields. Overrides default org. Doc from org. Removes all the fields with the given names.
| |
| remove | back to summary |
|---|---|
| public HttpFields. Overrides default org. Doc from org. Removes all the fields with the given name.
| |
| remove | back to summary |
|---|---|
| private void remove(int i) | |
| size | back to summary |
|---|---|
| public int size() Overrides default org.
| |
| stream | back to summary |
|---|---|
| public Stream Overrides default org.
| |
| toString | back to summary |
|---|---|
| public String toString() Overrides java. Doc from java. Returns a string representation of the object. | |
| Access | Constructor and Description |
|---|---|
| pack-priv |
| Modifier and Type | Method and Description |
|---|---|
| public void | add(HttpField
the element to insert field)Implements java. |
| public boolean | hasNext()
Implements java. true if this list iterator has more elements when
traversing the list in the forward direction.
|
| public boolean | hasPrevious()
Implements java. true if this list iterator has more elements when
traversing the list in the reverse direction.
|
| public HttpField | next()
Implements java. |
| public int | nextIndex()
Implements java. next.
|
| public HttpField | previous()
Implements java. |
| public int | previousIndex()
Implements java. previous.
|
| public void | remove()
Implements java. next or previous (optional operation).
|
| public void | set(HttpField
the element with which to replace the last element returned by
field)next or previousImplements java. next or
previous with the specified element (optional operation).
|
| Listerator | back to summary |
|---|---|
| pack-priv Listerator(int index) | |
| add | back to summary |
|---|---|
| public void add(HttpField field) Implements java. Doc from java. Inserts the specified element into the list (optional operation).
The element is inserted immediately before the element that
would be returned by | |
| hasNext | back to summary |
|---|---|
| public boolean hasNext() Implements java. Doc from java. Returns
| |
| hasPrevious | back to summary |
|---|---|
| public boolean hasPrevious() Implements java. Doc from java. Returns
| |
| next | back to summary |
|---|---|
| public HttpField next() Implements java. Doc from java. Returns the next element in the list and advances the cursor position.
This method may be called repeatedly to iterate through the list,
or intermixed with calls to | |
| nextIndex | back to summary |
|---|---|
| public int nextIndex() Implements java. Doc from java. Returns the index of the element that would be returned by a
subsequent call to
| |
| previous | back to summary |
|---|---|
| public HttpField previous() Implements java. Doc from java. Returns the previous element in the list and moves the cursor
position backwards. This method may be called repeatedly to
iterate through the list backwards, or intermixed with calls to
| |
| previousIndex | back to summary |
|---|---|
| public int previousIndex() Implements java. Doc from java. Returns the index of the element that would be returned by a
subsequent call to
| |
| remove | back to summary |
|---|---|
| public void remove() Implements java. Doc from java. Removes from the list the last element that was returned by
| |
| set | back to summary |
|---|---|
| public void set(HttpField field) Implements java. Doc from java. Replaces the last element returned by | |