Interface HeaderView

All Known Implementing Classes:
EmptyHeaderView, Http1HeaderMap, Http2HeaderMap, MutableHeaderMap

public interface HeaderView
The read-side, protocol-neutral contract every header container implements. HTTP/1.1 uses a byte-range-backed implementation; HTTP/2 uses HPACK-decoded name/value pairs. Neither concrete representation leaks into this interface.

RequestLine.getHeaders() exposes this interface rather than a protocol-specific implementation so request handling remains independent of the transport protocol.

Lifetime contract

Every implementation lives on the connection (HTTP/1.1) or the stream (HTTP/2), not per-request, and is repositioned in place between requests — never retain an instance past the handler that received it. String values returned by first(java.lang.String)/all(java.lang.String) are safe to retain (independent heap copies); ByteViews returned by view(java.lang.String) and passed to HeaderView.HeaderConsumer.accept(dev.relism.fpr.core.ByteView, dev.relism.fpr.core.ByteView) are not — see each implementation's own Javadoc for its exact reuse window.
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Interface
    Description
    static interface 
  • Method Summary

    Modifier and Type
    Method
    Description
    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.
    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.
  • Method Details

    • first

      String first(String name)
      Returns the first value of header name (case-insensitive), or null.
    • all

      List<String> all(String name)
      Returns all values of header name in declaration order, or an empty list.
    • all

      List<String> all()
      Returns all header values in declaration order.
    • view

      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.
    • valueEqualsIgnoreCase

      boolean valueEqualsIgnoreCase(String name, String value)
      Case-insensitive comparison of the first value of name against value.
    • contains

      boolean contains(String name)
      Whether any header named name is present.
    • count

      int count()
      Total number of header lines (not distinct names — a repeated header counts once per line).
    • forEach

      void forEach(HeaderView.HeaderConsumer consumer)
      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.