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

public static class HttpFields.Mutable.Wrapper extends Object implements HttpFields.Mutable
A wrapper of HttpFields instances.
  • Constructor Details

  • Method Details

    • onAddField

      public HttpField onAddField(HttpField field)
      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

      public boolean onRemoveField(HttpField field)
      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

      public HttpField onReplaceField(HttpField oldField, HttpField newField)
    • size

      public int size()
      Specified by:
      size in interface HttpFields
      Returns:
      the number of HttpFields in this instance
    • stream

      public Stream<HttpField> stream()
      Specified by:
      stream in interface HttpFields
      Returns:
      a sequential stream of the HttpFields in this instance
    • add

      public HttpFields.Mutable add(HttpField field)
      Description copied from interface: HttpFields.Mutable

      Adds the given HttpField to this instance.

      Specified by:
      add in interface HttpFields.Mutable
      Parameters:
      field - the HttpField to add
      Returns:
      this instance
    • put

      public HttpFields.Mutable put(HttpField field)
      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 interface HttpFields.Mutable
      Parameters:
      field - the field to put
      Returns:
      this instance
    • clear

      public HttpFields.Mutable clear()
      Description copied from interface: HttpFields.Mutable

      Removes all the fields from this instance.

      Specified by:
      clear in interface HttpFields.Mutable
      Returns:
      this instance
    • listIterator

      public ListIterator<HttpField> listIterator(int index)
      Specified by:
      listIterator in interface HttpFields
      Returns:
      an iterator over the HttpFields in this HttpFields starting at the given index.
      See Also: