Package dev.relism.flash.models
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 ClassesModifier and TypeInterfaceDescriptionstatic interface -
Method Summary
Modifier and TypeMethodDescriptionall()Returns all header values in declaration order.Returns all values of headernamein declaration order, or an empty list.booleanWhether any header namednameis present.intcount()Total number of header lines (not distinct names — a repeated header counts once per line).Returns the first value of headername(case-insensitive), ornull.voidforEach(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.booleanvalueEqualsIgnoreCase(String name, String value) Case-insensitive comparison of the first value ofnameagainstvalue.dev.relism.fpr.core.ByteViewReturns a view over the first value ofname, ornull— see the implementation's own reuse-window contract.
-
Method Details
-
first
Returns the first value of headername(case-insensitive), ornull. -
all
Returns all values of headernamein declaration order, or an empty list. -
all
Returns all header values in declaration order. -
view
Returns a view over the first value ofname, ornull— see the implementation's own reuse-window contract. -
valueEqualsIgnoreCase
Case-insensitive comparison of the first value ofnameagainstvalue. -
contains
Whether any header namednameis present. -
count
int count()Total number of header lines (not distinct names — a repeated header counts once per line). -
forEach
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.
-