Class MutableHeaderMap

java.lang.Object
dev.relism.flash.models.MutableHeaderMap
All Implemented Interfaces:
HeaderView

public final class MutableHeaderMap extends Object implements HeaderView
Reusable owned-byte header collection for sections parsed outside the request head buffer.
  • Nested Class Summary

    Nested classes/interfaces inherited from interface dev.relism.flash.models.HeaderView

    HeaderView.HeaderConsumer
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    add(byte[] name, int nameOffset, int nameLength, byte[] value, int valueOffset, int valueLength)
     
    all()
    Returns all header values in declaration order.
    all(String name)
    Returns all values of header name in declaration order, or an empty list.
    boolean
    Whether any header named name is present.
    int
    Total number of header lines (not distinct names — a repeated header counts once per line).
    first(String name)
    Returns the first value of header name (case-insensitive), or null.
    void
    Visits every header in declaration order without allocating a per-header object — see each implementation's Javadoc for exactly which instances are reused and their validity window.
    void
     
    boolean
    Case-insensitive comparison of the first value of name against value.
    dev.relism.fpr.core.ByteView
    view(String name)
    Returns a view over the first value of name, or null — see the implementation's own reuse-window contract.
    void
     

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • MutableHeaderMap

      public MutableHeaderMap()
  • Method Details

    • reset

      public void reset()
    • add

      public void add(byte[] name, int nameOffset, int nameLength, byte[] value, int valueOffset, int valueLength)
    • writeLines

      public void writeLines(OutputStream output) throws IOException
      Throws:
      IOException
    • first

      public String first(String name)
      Description copied from interface: HeaderView
      Returns the first value of header name (case-insensitive), or null.
      Specified by:
      first in interface HeaderView
    • all

      public List<String> all(String name)
      Description copied from interface: HeaderView
      Returns all values of header name in declaration order, or an empty list.
      Specified by:
      all in interface HeaderView
    • all

      public List<String> all()
      Description copied from interface: HeaderView
      Returns all header values in declaration order.
      Specified by:
      all in interface HeaderView
    • view

      public dev.relism.fpr.core.ByteView view(String name)
      Description copied from interface: HeaderView
      Returns a view over the first value of name, or null — see the implementation's own reuse-window contract.
      Specified by:
      view in interface HeaderView
    • valueEqualsIgnoreCase

      public boolean valueEqualsIgnoreCase(String name, String value)
      Description copied from interface: HeaderView
      Case-insensitive comparison of the first value of name against value.
      Specified by:
      valueEqualsIgnoreCase in interface HeaderView
    • contains

      public boolean contains(String name)
      Description copied from interface: HeaderView
      Whether any header named name is present.
      Specified by:
      contains in interface HeaderView
    • count

      public int count()
      Description copied from interface: HeaderView
      Total number of header lines (not distinct names — a repeated header counts once per line).
      Specified by:
      count in interface HeaderView
    • forEach

      public void forEach(HeaderView.HeaderConsumer consumer)
      Description copied from interface: HeaderView
      Visits every header in declaration order without allocating a per-header object — see each implementation's Javadoc for exactly which instances are reused and their validity window.
      Specified by:
      forEach in interface HeaderView