Package dev.relism.flash.models
Class MutableHeaderMap
java.lang.Object
dev.relism.flash.models.MutableHeaderMap
- All Implemented Interfaces:
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 -
Method Summary
Modifier and TypeMethodDescriptionvoidadd(byte[] name, int nameOffset, int nameLength, byte[] value, int valueOffset, int valueLength) all()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.voidreset()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.voidwriteLines(OutputStream output)
-
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
- Throws:
IOException
-
first
Description copied from interface:HeaderViewReturns the first value of headername(case-insensitive), ornull.- Specified by:
firstin interfaceHeaderView
-
all
Description copied from interface:HeaderViewReturns all values of headernamein declaration order, or an empty list.- Specified by:
allin interfaceHeaderView
-
all
Description copied from interface:HeaderViewReturns all header values in declaration order.- Specified by:
allin interfaceHeaderView
-
view
Description copied from interface:HeaderViewReturns a view over the first value ofname, ornull— see the implementation's own reuse-window contract.- Specified by:
viewin interfaceHeaderView
-
valueEqualsIgnoreCase
Description copied from interface:HeaderViewCase-insensitive comparison of the first value ofnameagainstvalue.- Specified by:
valueEqualsIgnoreCasein interfaceHeaderView
-
contains
Description copied from interface:HeaderViewWhether any header namednameis present.- Specified by:
containsin interfaceHeaderView
-
count
public int count()Description copied from interface:HeaderViewTotal number of header lines (not distinct names — a repeated header counts once per line).- Specified by:
countin interfaceHeaderView
-
forEach
Description copied from interface:HeaderViewVisits 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:
forEachin interfaceHeaderView
-