Class ReadOnlyHttp2Headers
- All Implemented Interfaces:
Headers<CharSequence, CharSequence, Http2Headers>, Http2Headers, Iterable<Map.Entry<CharSequence, CharSequence>>
Http2Headers which only supports read-only methods.
Any array passed to this class may be used directly in the underlying data structures of this class. If these arrays may be modified it is the caller's responsibility to supply this class with a copy of the array.
This may be a good alternative to DefaultHttp2Headers if your have a fixed set of headers which will not
change.
-
Nested Class Summary
Nested classes/interfaces inherited from interface Http2Headers
Http2Headers.PseudoHeaderName -
Method Summary
Modifier and TypeMethodDescriptionadd(Headers<? extends CharSequence, ? extends CharSequence, ?> headers) Adds all header names and values ofheadersto this object.add(CharSequence name, CharSequence value) Adds a new header with the specifiednameandvalue.add(CharSequence name, CharSequence... values) Adds new headers with the specifiednameandvalues.add(CharSequence name, Iterable<? extends CharSequence> values) Adds new headers with the specifiednameandvalues.addBoolean(CharSequence name, boolean value) Adds a new header.addByte(CharSequence name, byte value) Adds a new header.addChar(CharSequence name, char value) Adds a new header.addDouble(CharSequence name, double value) Adds a new header.addFloat(CharSequence name, float value) Adds a new header.addInt(CharSequence name, int value) Adds a new header.addLong(CharSequence name, long value) Adds a new header.addObject(CharSequence name, Iterable<?> values) Adds a new header with the specified name and values.addObject(CharSequence name, Object value) Adds a new header.addObject(CharSequence name, Object... values) Adds a new header with the specified name and values.addShort(CharSequence name, short value) Adds a new header.addTimeMillis(CharSequence name, long value) Adds a new header.Gets theHttp2Headers.PseudoHeaderName.AUTHORITYheader ornullif there is no such headerauthority(CharSequence value) Sets theHttp2Headers.PseudoHeaderName.AUTHORITYheaderclear()Removes all headers.static ReadOnlyHttp2HeadersclientHeaders(boolean validateHeaders, AsciiString method, AsciiString path, AsciiString scheme, AsciiString authority, AsciiString... otherHeaders) Create a new read only representation of headers used by clients.booleancontains(CharSequence name) Returnstrueif a header with thenameexists,falseotherwise.booleancontains(CharSequence name, CharSequence value) Returnstrueif a header with thenameandvalueexists,falseotherwise.booleancontains(CharSequence name, CharSequence value, boolean caseInsensitive) Returnstrueif a header with thenameandvalueexists,falseotherwise.booleancontainsBoolean(CharSequence name, boolean value) Returnstrueif a header with the name and value exists.booleancontainsByte(CharSequence name, byte value) Returnstrueif a header with the name and value exists.booleancontainsChar(CharSequence name, char value) Returnstrueif a header with the name and value exists.booleancontainsDouble(CharSequence name, double value) Returnstrueif a header with the name and value exists.booleancontainsFloat(CharSequence name, float value) Returnstrueif a header with the name and value exists.booleancontainsInt(CharSequence name, int value) Returnstrueif a header with the name and value exists.booleancontainsLong(CharSequence name, long value) Returnstrueif a header with the name and value exists.booleancontainsObject(CharSequence name, Object value) Returnstrueif a header with the name and value exists.booleancontainsShort(CharSequence name, short value) Returnstrueif a header with the name and value exists.booleancontainsTimeMillis(CharSequence name, long value) Returnstrueif a header with the name and value exists.get(CharSequence name) Returns the value of a header with the specified name.get(CharSequence name, CharSequence defaultValue) Returns the value of a header with the specified name.getAll(CharSequence name) Returns all values for the header with the specified name.getAllAndRemove(CharSequence name) Returns all values for the header with the specified name and removes them from this object.getAndRemove(CharSequence name) Returns the value of a header with the specified name and removes it from this object.getAndRemove(CharSequence name, CharSequence defaultValue) Returns the value of a header with the specified name and removes it from this object.getBoolean(CharSequence name) Returns thebooleanvalue of a header with the specified name.booleangetBoolean(CharSequence name, boolean defaultValue) Returns thebooleanvalue of a header with the specified name.Returns thebooleanvalue of a header with the specifiednameand removes the header from this object.booleangetBooleanAndRemove(CharSequence name, boolean defaultValue) Returns thebooleanvalue of a header with the specifiednameand removes the header from this object.getByte(CharSequence name) Returns thebytevalue of a header with the specified name.bytegetByte(CharSequence name, byte defaultValue) Returns thebytevalue of a header with the specified name.getByteAndRemove(CharSequence name) Returns thebytevalue of a header with the specifiednameand removes the header from this object.bytegetByteAndRemove(CharSequence name, byte defaultValue) Returns thebytevalue of a header with the specifiednameand removes the header from this object.getChar(CharSequence name) Returns thecharvalue of a header with the specified name.chargetChar(CharSequence name, char defaultValue) Returns thecharvalue of a header with the specified name.getCharAndRemove(CharSequence name) Returns thecharvalue of a header with the specifiednameand removes the header from this object.chargetCharAndRemove(CharSequence name, char defaultValue) Returns thecharvalue of a header with the specifiednameand removes the header from this object.getDouble(CharSequence name) Returns thedoublevalue of a header with the specified name.doublegetDouble(CharSequence name, double defaultValue) Returns thedoublevalue of a header with the specified name.Returns thedoublevalue of a header with the specifiednameand removes the header from this object.doublegetDoubleAndRemove(CharSequence name, double defaultValue) Returns thedoublevalue of a header with the specifiednameand removes the header from this object.getFloat(CharSequence name) Returns thefloatvalue of a header with the specified name.floatgetFloat(CharSequence name, float defaultValue) Returns thefloatvalue of a header with the specified name.Returns thefloatvalue of a header with the specifiednameand removes the header from this object.floatgetFloatAndRemove(CharSequence name, float defaultValue) Returns thefloatvalue of a header with the specifiednameand removes the header from this object.getInt(CharSequence name) Returns theintvalue of a header with the specified name.intgetInt(CharSequence name, int defaultValue) Returns theintvalue of a header with the specified name.getIntAndRemove(CharSequence name) Returns theintvalue of a header with the specifiednameand removes the header from this object.intgetIntAndRemove(CharSequence name, int defaultValue) Returns theintvalue of a header with the specifiednameand removes the header from this object.getLong(CharSequence name) Returns thelongvalue of a header with the specified name.longgetLong(CharSequence name, long defaultValue) Returns thelongvalue of a header with the specified name.getLongAndRemove(CharSequence name) Returns thelongvalue of a header with the specifiednameand removes the header from this object.longgetLongAndRemove(CharSequence name, long defaultValue) Returns thelongvalue of a header with the specifiednameand removes the header from this object.getShort(CharSequence name) Returns theshortvalue of a header with the specified name.shortgetShort(CharSequence name, short defaultValue) Returns theshortvalue of a header with the specified name.Returns theshortvalue of a header with the specifiednameand removes the header from this object.shortgetShortAndRemove(CharSequence name, short defaultValue) Returns theshortvalue of a header with the specifiednameand removes the header from this object.getTimeMillis(CharSequence name) Returns the value of a header with the specified name in milliseconds.longgetTimeMillis(CharSequence name, long defaultValue) Returns the value of a header with the specified name in milliseconds.Returns the value of a header with the specifiednamein milliseconds and removes the header from this object.longgetTimeMillisAndRemove(CharSequence name, long defaultValue) Returns the value of a header with the specifiednamein milliseconds and removes the header from this object.booleanisEmpty()iterator()Returns an iterator over all HTTP/2 headers.method()Gets theHttp2Headers.PseudoHeaderName.METHODheader ornullif there is no such headermethod(CharSequence value) Sets theHttp2Headers.PseudoHeaderName.METHODheadernames()Returns aSetof all header names in this object.path()Gets theHttp2Headers.PseudoHeaderName.PATHheader ornullif there is no such headerpath(CharSequence value) Sets theHttp2Headers.PseudoHeaderName.PATHheaderbooleanremove(CharSequence name) Removes all headers with the specifiedname.scheme()Gets theHttp2Headers.PseudoHeaderName.SCHEMEheader ornullif there is no such headerscheme(CharSequence value) Sets theHttp2Headers.PseudoHeaderName.SCHEMEheaderstatic ReadOnlyHttp2HeadersserverHeaders(boolean validateHeaders, AsciiString status, AsciiString... otherHeaders) Create a new read only representation of headers used by servers.set(Headers<? extends CharSequence, ? extends CharSequence, ?> headers) Clears the current header entries and copies all header entries of the specifiedheaders.set(CharSequence name, CharSequence value) Sets a header with the specified name and value.set(CharSequence name, CharSequence... values) Sets a header with the specified name and values.set(CharSequence name, Iterable<? extends CharSequence> values) Sets a new header with the specified name and values.setAll(Headers<? extends CharSequence, ? extends CharSequence, ?> headers) Retains all current headers but callsHeaders.set(K, V)for each entry inheaders.setBoolean(CharSequence name, boolean value) Set thenametovalue.setByte(CharSequence name, byte value) Set thenametovalue.setChar(CharSequence name, char value) Set thenametovalue.setDouble(CharSequence name, double value) Set thenametovalue.setFloat(CharSequence name, float value) Set thenametovalue.setInt(CharSequence name, int value) Set thenametovalue.setLong(CharSequence name, long value) Set thenametovalue.setObject(CharSequence name, Iterable<?> values) Sets a header with the specified name and values.setObject(CharSequence name, Object value) Sets a new header.setObject(CharSequence name, Object... values) Sets a header with the specified name and values.setShort(CharSequence name, short value) Set thenametovalue.setTimeMillis(CharSequence name, long value) Set thenametovalue.intsize()Returns the number of headers in this object.status()Gets theHttp2Headers.PseudoHeaderName.STATUSheader ornullif there is no such headerstatus(CharSequence value) Sets theHttp2Headers.PseudoHeaderName.STATUSheadertoString()static ReadOnlyHttp2Headerstrailers(boolean validateHeaders, AsciiString... otherHeaders) Used to create read only object designed to represent trailers.valueIterator(CharSequence name) Equivalent toHeaders.getAll(Object)but no intermediate list is generated.Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface Iterable
forEach, spliterator
-
Method Details
-
trailers
Used to create read only object designed to represent trailers.If this is used for a purpose other than trailers you may violate the header serialization ordering defined by RFC 7540, 8.1.2.1.
- Parameters:
validateHeaders-truewill run validation on each header name/value pair to ensure protocol compliance.otherHeaders- An array of key:value pairs. Must not contain any pseudo headers ornullnames/values. A copy will NOT be made of this array. If the contents of this array may be modified externally you are responsible for passing in a copy.- Returns:
- A read only representation of the headers.
-
clientHeaders
public static ReadOnlyHttp2Headers clientHeaders(boolean validateHeaders, AsciiString method, AsciiString path, AsciiString scheme, AsciiString authority, AsciiString... otherHeaders) Create a new read only representation of headers used by clients.- Parameters:
validateHeaders-truewill run validation on each header name/value pair to ensure protocol compliance.method- The value forHttp2Headers.PseudoHeaderName.METHOD.path- The value forHttp2Headers.PseudoHeaderName.PATH.scheme- The value forHttp2Headers.PseudoHeaderName.SCHEME.authority- The value forHttp2Headers.PseudoHeaderName.AUTHORITY.otherHeaders- An array of key:value pairs. Must not contain any pseudo headers ornullnames/values. A copy will NOT be made of this array. If the contents of this array may be modified externally you are responsible for passing in a copy.- Returns:
- a new read only representation of headers used by clients.
-
serverHeaders
public static ReadOnlyHttp2Headers serverHeaders(boolean validateHeaders, AsciiString status, AsciiString... otherHeaders) Create a new read only representation of headers used by servers.- Parameters:
validateHeaders-truewill run validation on each header name/value pair to ensure protocol compliance.status- The value forHttp2Headers.PseudoHeaderName.STATUS.otherHeaders- An array of key:value pairs. Must not contain any pseudo headers ornullnames/values. A copy will NOT be made of this array. If the contents of this array may be modified externally you are responsible for passing in a copy.- Returns:
- a new read only representation of headers used by servers.
-
get
Description copied from interface:HeadersReturns the value of a header with the specified name. If there is more than one value for the specified name, the first value in insertion order is returned.- Specified by:
getin interfaceHeaders<CharSequence, CharSequence, Http2Headers>- Parameters:
name- the name of the header to retrieve- Returns:
- the first header value if the header is found.
nullif there's no such header
-
get
Description copied from interface:HeadersReturns the value of a header with the specified name. If there is more than one value for the specified name, the first value in insertion order is returned.- Specified by:
getin interfaceHeaders<CharSequence, CharSequence, Http2Headers>- Parameters:
name- the name of the header to retrievedefaultValue- the default value- Returns:
- the first header value or
defaultValueif there is no such header
-
getAndRemove
Description copied from interface:HeadersReturns the value of a header with the specified name and removes it from this object. If there is more than one value for the specified name, the first value in insertion order is returned.- Specified by:
getAndRemovein interfaceHeaders<CharSequence, CharSequence, Http2Headers>- Parameters:
name- the name of the header to retrieve- Returns:
- the first header value or
nullif there is no such header
-
getAndRemove
Description copied from interface:HeadersReturns the value of a header with the specified name and removes it from this object. If there is more than one value for the specified name, the first value in insertion order is returned.- Specified by:
getAndRemovein interfaceHeaders<CharSequence, CharSequence, Http2Headers>- Parameters:
name- the name of the header to retrievedefaultValue- the default value- Returns:
- the first header value or
defaultValueif there is no such header
-
getAll
Description copied from interface:HeadersReturns all values for the header with the specified name. The returnedListcan't be modified.- Specified by:
getAllin interfaceHeaders<CharSequence, CharSequence, Http2Headers>- Parameters:
name- the name of the header to retrieve- Returns:
- a
Listof header values or an emptyListif no values are found.
-
getAllAndRemove
Description copied from interface:HeadersReturns all values for the header with the specified name and removes them from this object. The returnedListcan't be modified.- Specified by:
getAllAndRemovein interfaceHeaders<CharSequence, CharSequence, Http2Headers>- Parameters:
name- the name of the header to retrieve- Returns:
- a
Listof header values or an emptyListif no values are found.
-
getBoolean
Description copied from interface:HeadersReturns thebooleanvalue of a header with the specified name. If there is more than one value for the specified name, the first value in insertion order is returned.- Specified by:
getBooleanin interfaceHeaders<CharSequence, CharSequence, Http2Headers>- Parameters:
name- the name of the header to retrieve- Returns:
- the
booleanvalue of the first value in insertion order ornullif there is no such value or it can't be converted toboolean.
-
getBoolean
Description copied from interface:HeadersReturns thebooleanvalue of a header with the specified name. If there is more than one value for the specified name, the first value in insertion order is returned.- Specified by:
getBooleanin interfaceHeaders<CharSequence, CharSequence, Http2Headers>- Parameters:
name- the name of the header to retrievedefaultValue- the default value- Returns:
- the
booleanvalue of the first value in insertion order ordefaultValueif there is no such value or it can't be converted toboolean.
-
getByte
Description copied from interface:HeadersReturns thebytevalue of a header with the specified name. If there is more than one value for the specified name, the first value in insertion order is returned.- Specified by:
getBytein interfaceHeaders<CharSequence, CharSequence, Http2Headers>- Parameters:
name- the name of the header to retrieve- Returns:
- the
bytevalue of the first value in insertion order ornullif there is no such value or it can't be converted tobyte.
-
getByte
Description copied from interface:HeadersReturns thebytevalue of a header with the specified name. If there is more than one value for the specified name, the first value in insertion order is returned.- Specified by:
getBytein interfaceHeaders<CharSequence, CharSequence, Http2Headers>- Parameters:
name- the name of the header to retrievedefaultValue- the default value- Returns:
- the
bytevalue of the first value in insertion order ordefaultValueif there is no such value or it can't be converted tobyte.
-
getChar
Description copied from interface:HeadersReturns thecharvalue of a header with the specified name. If there is more than one value for the specified name, the first value in insertion order is returned.- Specified by:
getCharin interfaceHeaders<CharSequence, CharSequence, Http2Headers>- Parameters:
name- the name of the header to retrieve- Returns:
- the
charvalue of the first value in insertion order ornullif there is no such value or it can't be converted tochar.
-
getChar
Description copied from interface:HeadersReturns thecharvalue of a header with the specified name. If there is more than one value for the specified name, the first value in insertion order is returned.- Specified by:
getCharin interfaceHeaders<CharSequence, CharSequence, Http2Headers>- Parameters:
name- the name of the header to retrievedefaultValue- the default value- Returns:
- the
charvalue of the first value in insertion order ordefaultValueif there is no such value or it can't be converted tochar.
-
getShort
Description copied from interface:HeadersReturns theshortvalue of a header with the specified name. If there is more than one value for the specified name, the first value in insertion order is returned.- Specified by:
getShortin interfaceHeaders<CharSequence, CharSequence, Http2Headers>- Parameters:
name- the name of the header to retrieve- Returns:
- the
shortvalue of the first value in insertion order ornullif there is no such value or it can't be converted toshort.
-
getShort
Description copied from interface:HeadersReturns theshortvalue of a header with the specified name. If there is more than one value for the specified name, the first value in insertion order is returned.- Specified by:
getShortin interfaceHeaders<CharSequence, CharSequence, Http2Headers>- Parameters:
name- the name of the header to retrievedefaultValue- the default value- Returns:
- the
shortvalue of the first value in insertion order ordefaultValueif there is no such value or it can't be converted toshort.
-
getInt
Description copied from interface:HeadersReturns theintvalue of a header with the specified name. If there is more than one value for the specified name, the first value in insertion order is returned.- Specified by:
getIntin interfaceHeaders<CharSequence, CharSequence, Http2Headers>- Parameters:
name- the name of the header to retrieve- Returns:
- the
intvalue of the first value in insertion order ornullif there is no such value or it can't be converted toint.
-
getInt
Description copied from interface:HeadersReturns theintvalue of a header with the specified name. If there is more than one value for the specified name, the first value in insertion order is returned.- Specified by:
getIntin interfaceHeaders<CharSequence, CharSequence, Http2Headers>- Parameters:
name- the name of the header to retrievedefaultValue- the default value- Returns:
- the
intvalue of the first value in insertion order ordefaultValueif there is no such value or it can't be converted toint.
-
getLong
Description copied from interface:HeadersReturns thelongvalue of a header with the specified name. If there is more than one value for the specified name, the first value in insertion order is returned.- Specified by:
getLongin interfaceHeaders<CharSequence, CharSequence, Http2Headers>- Parameters:
name- the name of the header to retrieve- Returns:
- the
longvalue of the first value in insertion order ornullif there is no such value or it can't be converted tolong.
-
getLong
Description copied from interface:HeadersReturns thelongvalue of a header with the specified name. If there is more than one value for the specified name, the first value in insertion order is returned.- Specified by:
getLongin interfaceHeaders<CharSequence, CharSequence, Http2Headers>- Parameters:
name- the name of the header to retrievedefaultValue- the default value- Returns:
- the
longvalue of the first value in insertion order ordefaultValueif there is no such value or it can't be converted tolong.
-
getFloat
Description copied from interface:HeadersReturns thefloatvalue of a header with the specified name. If there is more than one value for the specified name, the first value in insertion order is returned.- Specified by:
getFloatin interfaceHeaders<CharSequence, CharSequence, Http2Headers>- Parameters:
name- the name of the header to retrieve- Returns:
- the
floatvalue of the first value in insertion order ornullif there is no such value or it can't be converted tofloat.
-
getFloat
Description copied from interface:HeadersReturns thefloatvalue of a header with the specified name. If there is more than one value for the specified name, the first value in insertion order is returned.- Specified by:
getFloatin interfaceHeaders<CharSequence, CharSequence, Http2Headers>- Parameters:
name- the name of the header to retrievedefaultValue- the default value- Returns:
- the
floatvalue of the first value in insertion order ordefaultValueif there is no such value or it can't be converted tofloat.
-
getDouble
Description copied from interface:HeadersReturns thedoublevalue of a header with the specified name. If there is more than one value for the specified name, the first value in insertion order is returned.- Specified by:
getDoublein interfaceHeaders<CharSequence, CharSequence, Http2Headers>- Parameters:
name- the name of the header to retrieve- Returns:
- the
doublevalue of the first value in insertion order ornullif there is no such value or it can't be converted todouble.
-
getDouble
Description copied from interface:HeadersReturns thedoublevalue of a header with the specified name. If there is more than one value for the specified name, the first value in insertion order is returned.- Specified by:
getDoublein interfaceHeaders<CharSequence, CharSequence, Http2Headers>- Parameters:
name- the name of the header to retrievedefaultValue- the default value- Returns:
- the
doublevalue of the first value in insertion order ordefaultValueif there is no such value or it can't be converted todouble.
-
getTimeMillis
Description copied from interface:HeadersReturns the value of a header with the specified name in milliseconds. If there is more than one value for the specified name, the first value in insertion order is returned.- Specified by:
getTimeMillisin interfaceHeaders<CharSequence, CharSequence, Http2Headers>- Parameters:
name- the name of the header to retrieve- Returns:
- the milliseconds value of the first value in insertion order or
nullif there is no such value or it can't be converted to milliseconds.
-
getTimeMillis
Description copied from interface:HeadersReturns the value of a header with the specified name in milliseconds. If there is more than one value for the specified name, the first value in insertion order is returned.- Specified by:
getTimeMillisin interfaceHeaders<CharSequence, CharSequence, Http2Headers>- Parameters:
name- the name of the header to retrievedefaultValue- the default value- Returns:
- the milliseconds value of the first value in insertion order or
defaultValueif there is no such value or it can't be converted to milliseconds.
-
getBooleanAndRemove
Description copied from interface:HeadersReturns thebooleanvalue of a header with the specifiednameand removes the header from this object. If there is more than one value for the specified name, the first value in insertion order is returned. In any case all values fornameare removed.If an exception occurs during the translation from type
Tall entries withnamemay still be removed.- Specified by:
getBooleanAndRemovein interfaceHeaders<CharSequence, CharSequence, Http2Headers>- Parameters:
name- the name of the header to retrieve- Returns:
- the
booleanvalue of the first value in insertion order ornullif there is no such value or it can't be converted toboolean.
-
getBooleanAndRemove
Description copied from interface:HeadersReturns thebooleanvalue of a header with the specifiednameand removes the header from this object. If there is more than one value for the specified name, the first value in insertion order is returned. In any case all values fornameare removed.If an exception occurs during the translation from type
Tall entries withnamemay still be removed.- Specified by:
getBooleanAndRemovein interfaceHeaders<CharSequence, CharSequence, Http2Headers>- Parameters:
name- the name of the header to searchdefaultValue- the default value- Returns:
- the
booleanvalue of the first value in insertion order ordefaultValueif there is no such value or it can't be converted toboolean.
-
getByteAndRemove
Description copied from interface:HeadersReturns thebytevalue of a header with the specifiednameand removes the header from this object. If there is more than one value for the specified name, the first value in insertion order is returned. In any case all values fornameare removed.If an exception occurs during the translation from type
Tall entries withnamemay still be removed.- Specified by:
getByteAndRemovein interfaceHeaders<CharSequence, CharSequence, Http2Headers>- Parameters:
name- the name of the header to search- Returns:
- the
bytevalue of the first value in insertion order ornullif there is no such value or it can't be converted tobyte.
-
getByteAndRemove
Description copied from interface:HeadersReturns thebytevalue of a header with the specifiednameand removes the header from this object. If there is more than one value for the specified name, the first value in insertion order is returned. In any case all values fornameare removed.If an exception occurs during the translation from type
Tall entries withnamemay still be removed.- Specified by:
getByteAndRemovein interfaceHeaders<CharSequence, CharSequence, Http2Headers>- Parameters:
name- the name of the header to searchdefaultValue- the default value- Returns:
- the
bytevalue of the first value in insertion order ordefaultValueif there is no such value or it can't be converted tobyte.
-
getCharAndRemove
Description copied from interface:HeadersReturns thecharvalue of a header with the specifiednameand removes the header from this object. If there is more than one value for the specified name, the first value in insertion order is returned. In any case all values fornameare removed.If an exception occurs during the translation from type
Tall entries withnamemay still be removed.- Specified by:
getCharAndRemovein interfaceHeaders<CharSequence, CharSequence, Http2Headers>- Parameters:
name- the name of the header to search- Returns:
- the
charvalue of the first value in insertion order ornullif there is no such value or it can't be converted tochar.
-
getCharAndRemove
Description copied from interface:HeadersReturns thecharvalue of a header with the specifiednameand removes the header from this object. If there is more than one value for the specified name, the first value in insertion order is returned. In any case all values fornameare removed.If an exception occurs during the translation from type
Tall entries withnamemay still be removed.- Specified by:
getCharAndRemovein interfaceHeaders<CharSequence, CharSequence, Http2Headers>- Parameters:
name- the name of the header to searchdefaultValue- the default value- Returns:
- the
charvalue of the first value in insertion order ordefaultValueif there is no such value or it can't be converted tochar.
-
getShortAndRemove
Description copied from interface:HeadersReturns theshortvalue of a header with the specifiednameand removes the header from this object. If there is more than one value for the specified name, the first value in insertion order is returned. In any case all values fornameare removed.If an exception occurs during the translation from type
Tall entries withnamemay still be removed.- Specified by:
getShortAndRemovein interfaceHeaders<CharSequence, CharSequence, Http2Headers>- Parameters:
name- the name of the header to search- Returns:
- the
shortvalue of the first value in insertion order ornullif there is no such value or it can't be converted toshort.
-
getShortAndRemove
Description copied from interface:HeadersReturns theshortvalue of a header with the specifiednameand removes the header from this object. If there is more than one value for the specified name, the first value in insertion order is returned. In any case all values fornameare removed.If an exception occurs during the translation from type
Tall entries withnamemay still be removed.- Specified by:
getShortAndRemovein interfaceHeaders<CharSequence, CharSequence, Http2Headers>- Parameters:
name- the name of the header to searchdefaultValue- the default value- Returns:
- the
shortvalue of the first value in insertion order ordefaultValueif there is no such value or it can't be converted toshort.
-
getIntAndRemove
Description copied from interface:HeadersReturns theintvalue of a header with the specifiednameand removes the header from this object. If there is more than one value for the specified name, the first value in insertion order is returned. In any case all values fornameare removed.If an exception occurs during the translation from type
Tall entries withnamemay still be removed.- Specified by:
getIntAndRemovein interfaceHeaders<CharSequence, CharSequence, Http2Headers>- Parameters:
name- the name of the header to search- Returns:
- the
intvalue of the first value in insertion order ornullif there is no such value or it can't be converted toint.
-
getIntAndRemove
Description copied from interface:HeadersReturns theintvalue of a header with the specifiednameand removes the header from this object. If there is more than one value for the specified name, the first value in insertion order is returned. In any case all values fornameare removed.If an exception occurs during the translation from type
Tall entries withnamemay still be removed.- Specified by:
getIntAndRemovein interfaceHeaders<CharSequence, CharSequence, Http2Headers>- Parameters:
name- the name of the header to searchdefaultValue- the default value- Returns:
- the
intvalue of the first value in insertion order ordefaultValueif there is no such value or it can't be converted toint.
-
getLongAndRemove
Description copied from interface:HeadersReturns thelongvalue of a header with the specifiednameand removes the header from this object. If there is more than one value for the specified name, the first value in insertion order is returned. In any case all values fornameare removed.If an exception occurs during the translation from type
Tall entries withnamemay still be removed.- Specified by:
getLongAndRemovein interfaceHeaders<CharSequence, CharSequence, Http2Headers>- Parameters:
name- the name of the header to search- Returns:
- the
longvalue of the first value in insertion order ornullif there is no such value or it can't be converted tolong.
-
getLongAndRemove
Description copied from interface:HeadersReturns thelongvalue of a header with the specifiednameand removes the header from this object. If there is more than one value for the specified name, the first value in insertion order is returned. In any case all values fornameare removed.If an exception occurs during the translation from type
Tall entries withnamemay still be removed.- Specified by:
getLongAndRemovein interfaceHeaders<CharSequence, CharSequence, Http2Headers>- Parameters:
name- the name of the header to searchdefaultValue- the default value- Returns:
- the
longvalue of the first value in insertion order ordefaultValueif there is no such value or it can't be converted tolong.
-
getFloatAndRemove
Description copied from interface:HeadersReturns thefloatvalue of a header with the specifiednameand removes the header from this object. If there is more than one value for the specified name, the first value in insertion order is returned. In any case all values fornameare removed.If an exception occurs during the translation from type
Tall entries withnamemay still be removed.- Specified by:
getFloatAndRemovein interfaceHeaders<CharSequence, CharSequence, Http2Headers>- Parameters:
name- the name of the header to search- Returns:
- the
floatvalue of the first value in insertion order ornullif there is no such value or it can't be converted tofloat.
-
getFloatAndRemove
Description copied from interface:HeadersReturns thefloatvalue of a header with the specifiednameand removes the header from this object. If there is more than one value for the specified name, the first value in insertion order is returned. In any case all values fornameare removed.If an exception occurs during the translation from type
Tall entries withnamemay still be removed.- Specified by:
getFloatAndRemovein interfaceHeaders<CharSequence, CharSequence, Http2Headers>- Parameters:
name- the name of the header to searchdefaultValue- the default value- Returns:
- the
floatvalue of the first value in insertion order ordefaultValueif there is no such value or it can't be converted tofloat.
-
getDoubleAndRemove
Description copied from interface:HeadersReturns thedoublevalue of a header with the specifiednameand removes the header from this object. If there is more than one value for the specified name, the first value in insertion order is returned. In any case all values fornameare removed.If an exception occurs during the translation from type
Tall entries withnamemay still be removed.- Specified by:
getDoubleAndRemovein interfaceHeaders<CharSequence, CharSequence, Http2Headers>- Parameters:
name- the name of the header to search- Returns:
- the
doublevalue of the first value in insertion order ornullif there is no such value or it can't be converted todouble.
-
getDoubleAndRemove
Description copied from interface:HeadersReturns thedoublevalue of a header with the specifiednameand removes the header from this object. If there is more than one value for the specified name, the first value in insertion order is returned. In any case all values fornameare removed.If an exception occurs during the translation from type
Tall entries withnamemay still be removed.- Specified by:
getDoubleAndRemovein interfaceHeaders<CharSequence, CharSequence, Http2Headers>- Parameters:
name- the name of the header to searchdefaultValue- the default value- Returns:
- the
doublevalue of the first value in insertion order ordefaultValueif there is no such value or it can't be converted todouble.
-
getTimeMillisAndRemove
Description copied from interface:HeadersReturns the value of a header with the specifiednamein milliseconds and removes the header from this object. If there is more than one value for the specifiedname, the first value in insertion order is returned. In any case all values fornameare removed.If an exception occurs during the translation from type
Tall entries withnamemay still be removed.- Specified by:
getTimeMillisAndRemovein interfaceHeaders<CharSequence, CharSequence, Http2Headers>- Parameters:
name- the name of the header to retrieve- Returns:
- the milliseconds value of the first value in insertion order or
nullif there is no such value or it can't be converted to milliseconds.
-
getTimeMillisAndRemove
Description copied from interface:HeadersReturns the value of a header with the specifiednamein milliseconds and removes the header from this object. If there is more than one value for the specifiedname, the first value in insertion order is returned. In any case all values fornameare removed.If an exception occurs during the translation from type
Tall entries withnamemay still be removed.- Specified by:
getTimeMillisAndRemovein interfaceHeaders<CharSequence, CharSequence, Http2Headers>- Parameters:
name- the name of the header to retrievedefaultValue- the default value- Returns:
- the milliseconds value of the first value in insertion order or
defaultValueif there is no such value or it can't be converted to milliseconds.
-
contains
Description copied from interface:HeadersReturnstrueif a header with thenameexists,falseotherwise.- Specified by:
containsin interfaceHeaders<CharSequence, CharSequence, Http2Headers>- Parameters:
name- the header name
-
contains
Description copied from interface:HeadersReturnstrueif a header with thenameandvalueexists,falseotherwise.The
Object.equals(Object)method is used to test for equality ofvalue.- Specified by:
containsin interfaceHeaders<CharSequence, CharSequence, Http2Headers>- Parameters:
name- the header namevalue- the header value of the header to find
-
containsObject
Description copied from interface:HeadersReturnstrueif a header with the name and value exists.- Specified by:
containsObjectin interfaceHeaders<CharSequence, CharSequence, Http2Headers>- Parameters:
name- the header namevalue- the header value- Returns:
trueif it contains itfalseotherwise
-
containsBoolean
Description copied from interface:HeadersReturnstrueif a header with the name and value exists.- Specified by:
containsBooleanin interfaceHeaders<CharSequence, CharSequence, Http2Headers>- Parameters:
name- the header namevalue- the header value- Returns:
trueif it contains itfalseotherwise
-
containsByte
Description copied from interface:HeadersReturnstrueif a header with the name and value exists.- Specified by:
containsBytein interfaceHeaders<CharSequence, CharSequence, Http2Headers>- Parameters:
name- the header namevalue- the header value- Returns:
trueif it contains itfalseotherwise
-
containsChar
Description copied from interface:HeadersReturnstrueif a header with the name and value exists.- Specified by:
containsCharin interfaceHeaders<CharSequence, CharSequence, Http2Headers>- Parameters:
name- the header namevalue- the header value- Returns:
trueif it contains itfalseotherwise
-
containsShort
Description copied from interface:HeadersReturnstrueif a header with the name and value exists.- Specified by:
containsShortin interfaceHeaders<CharSequence, CharSequence, Http2Headers>- Parameters:
name- the header namevalue- the header value- Returns:
trueif it contains itfalseotherwise
-
containsInt
Description copied from interface:HeadersReturnstrueif a header with the name and value exists.- Specified by:
containsIntin interfaceHeaders<CharSequence, CharSequence, Http2Headers>- Parameters:
name- the header namevalue- the header value- Returns:
trueif it contains itfalseotherwise
-
containsLong
Description copied from interface:HeadersReturnstrueif a header with the name and value exists.- Specified by:
containsLongin interfaceHeaders<CharSequence, CharSequence, Http2Headers>- Parameters:
name- the header namevalue- the header value- Returns:
trueif it contains itfalseotherwise
-
containsFloat
Description copied from interface:HeadersReturnstrueif a header with the name and value exists.- Specified by:
containsFloatin interfaceHeaders<CharSequence, CharSequence, Http2Headers>- Parameters:
name- the header namevalue- the header value- Returns:
trueif it contains itfalseotherwise
-
containsDouble
Description copied from interface:HeadersReturnstrueif a header with the name and value exists.- Specified by:
containsDoublein interfaceHeaders<CharSequence, CharSequence, Http2Headers>- Parameters:
name- the header namevalue- the header value- Returns:
trueif it contains itfalseotherwise
-
containsTimeMillis
Description copied from interface:HeadersReturnstrueif a header with the name and value exists.- Specified by:
containsTimeMillisin interfaceHeaders<CharSequence, CharSequence, Http2Headers>- Parameters:
name- the header namevalue- the header value- Returns:
trueif it contains itfalseotherwise
-
size
public int size()Description copied from interface:HeadersReturns the number of headers in this object.- Specified by:
sizein interfaceHeaders<CharSequence, CharSequence, Http2Headers>
-
isEmpty
public boolean isEmpty()Description copied from interface:Headers- Specified by:
isEmptyin interfaceHeaders<CharSequence, CharSequence, Http2Headers>
-
names
Description copied from interface:Headers- Specified by:
namesin interfaceHeaders<CharSequence, CharSequence, Http2Headers>
-
add
Description copied from interface:HeadersAdds a new header with the specifiednameandvalue.- Specified by:
addin interfaceHeaders<CharSequence, CharSequence, Http2Headers>- Parameters:
name- the name of the headervalue- the value of the header- Returns:
this
-
add
Description copied from interface:HeadersAdds new headers with the specifiednameandvalues. This method is semantically equivalent tofor (T value : values) { headers.add(name, value); }- Specified by:
addin interfaceHeaders<CharSequence, CharSequence, Http2Headers>- Parameters:
name- the header namevalues- the values of the header- Returns:
this
-
add
Description copied from interface:HeadersAdds new headers with the specifiednameandvalues. This method is semantically equivalent tofor (T value : values) { headers.add(name, value); }- Specified by:
addin interfaceHeaders<CharSequence, CharSequence, Http2Headers>- Parameters:
name- the header namevalues- the values of the header- Returns:
this
-
addObject
Description copied from interface:HeadersAdds a new header. Before thevalueis added, it's converted to typeT.- Specified by:
addObjectin interfaceHeaders<CharSequence, CharSequence, Http2Headers>- Parameters:
name- the header namevalue- the value of the header- Returns:
this
-
addObject
Description copied from interface:HeadersAdds a new header with the specified name and values. This method is equivalent tofor (Object v : values) { headers.addObject(name, v); }- Specified by:
addObjectin interfaceHeaders<CharSequence, CharSequence, Http2Headers>- Parameters:
name- the header namevalues- the value of the header- Returns:
this
-
addObject
Description copied from interface:HeadersAdds a new header with the specified name and values. This method is equivalent tofor (Object v : values) { headers.addObject(name, v); }- Specified by:
addObjectin interfaceHeaders<CharSequence, CharSequence, Http2Headers>- Parameters:
name- the header namevalues- the value of the header- Returns:
this
-
addBoolean
Description copied from interface:HeadersAdds a new header.- Specified by:
addBooleanin interfaceHeaders<CharSequence, CharSequence, Http2Headers>- Parameters:
name- the header namevalue- the value of the header- Returns:
this
-
addByte
Description copied from interface:HeadersAdds a new header.- Specified by:
addBytein interfaceHeaders<CharSequence, CharSequence, Http2Headers>- Parameters:
name- the header namevalue- the value of the header- Returns:
this
-
addChar
Description copied from interface:HeadersAdds a new header.- Specified by:
addCharin interfaceHeaders<CharSequence, CharSequence, Http2Headers>- Parameters:
name- the header namevalue- the value of the header- Returns:
this
-
addShort
Description copied from interface:HeadersAdds a new header.- Specified by:
addShortin interfaceHeaders<CharSequence, CharSequence, Http2Headers>- Parameters:
name- the header namevalue- the value of the header- Returns:
this
-
addInt
Description copied from interface:HeadersAdds a new header.- Specified by:
addIntin interfaceHeaders<CharSequence, CharSequence, Http2Headers>- Parameters:
name- the header namevalue- the value of the header- Returns:
this
-
addLong
Description copied from interface:HeadersAdds a new header.- Specified by:
addLongin interfaceHeaders<CharSequence, CharSequence, Http2Headers>- Parameters:
name- the header namevalue- the value of the header- Returns:
this
-
addFloat
Description copied from interface:HeadersAdds a new header.- Specified by:
addFloatin interfaceHeaders<CharSequence, CharSequence, Http2Headers>- Parameters:
name- the header namevalue- the value of the header- Returns:
this
-
addDouble
Description copied from interface:HeadersAdds a new header.- Specified by:
addDoublein interfaceHeaders<CharSequence, CharSequence, Http2Headers>- Parameters:
name- the header namevalue- the value of the header- Returns:
this
-
addTimeMillis
Description copied from interface:HeadersAdds a new header.- Specified by:
addTimeMillisin interfaceHeaders<CharSequence, CharSequence, Http2Headers>- Parameters:
name- the header namevalue- the value of the header- Returns:
this
-
add
Description copied from interface:HeadersAdds all header names and values ofheadersto this object.- Specified by:
addin interfaceHeaders<CharSequence, CharSequence, Http2Headers>- Returns:
this
-
set
Description copied from interface:HeadersSets a header with the specified name and value. Any existing headers with the same name are overwritten.- Specified by:
setin interfaceHeaders<CharSequence, CharSequence, Http2Headers>- Parameters:
name- the header namevalue- the value of the header- Returns:
this
-
set
Description copied from interface:HeadersSets a new header with the specified name and values. This method is equivalent tofor (T v : values) { headers.addObject(name, v); }- Specified by:
setin interfaceHeaders<CharSequence, CharSequence, Http2Headers>- Parameters:
name- the header namevalues- the value of the header- Returns:
this
-
set
Description copied from interface:HeadersSets a header with the specified name and values. Any existing headers with this name are removed. This method is equivalent to:headers.remove(name); for (T v : values) { headers.add(name, v); }- Specified by:
setin interfaceHeaders<CharSequence, CharSequence, Http2Headers>- Parameters:
name- the header namevalues- the value of the header- Returns:
this
-
setObject
Description copied from interface:HeadersSets a new header. Any existing headers with this name are removed. Before thevalueis add, it's converted to typeT.- Specified by:
setObjectin interfaceHeaders<CharSequence, CharSequence, Http2Headers>- Parameters:
name- the header namevalue- the value of the header- Returns:
this
-
setObject
Description copied from interface:HeadersSets a header with the specified name and values. Any existing headers with this name are removed. This method is equivalent to:headers.remove(name); for (Object v : values) { headers.addObject(name, v); }- Specified by:
setObjectin interfaceHeaders<CharSequence, CharSequence, Http2Headers>- Parameters:
name- the header namevalues- the values of the header- Returns:
this
-
setObject
Description copied from interface:HeadersSets a header with the specified name and values. Any existing headers with this name are removed. This method is equivalent to:headers.remove(name); for (Object v : values) { headers.addObject(name, v); }- Specified by:
setObjectin interfaceHeaders<CharSequence, CharSequence, Http2Headers>- Parameters:
name- the header namevalues- the values of the header- Returns:
this
-
setBoolean
Description copied from interface:HeadersSet thenametovalue. This will remove all previous values associated withname.- Specified by:
setBooleanin interfaceHeaders<CharSequence, CharSequence, Http2Headers>- Parameters:
name- The name to modifyvalue- The value- Returns:
this
-
setByte
Description copied from interface:HeadersSet thenametovalue. This will remove all previous values associated withname.- Specified by:
setBytein interfaceHeaders<CharSequence, CharSequence, Http2Headers>- Parameters:
name- The name to modifyvalue- The value- Returns:
this
-
setChar
Description copied from interface:HeadersSet thenametovalue. This will remove all previous values associated withname.- Specified by:
setCharin interfaceHeaders<CharSequence, CharSequence, Http2Headers>- Parameters:
name- The name to modifyvalue- The value- Returns:
this
-
setShort
Description copied from interface:HeadersSet thenametovalue. This will remove all previous values associated withname.- Specified by:
setShortin interfaceHeaders<CharSequence, CharSequence, Http2Headers>- Parameters:
name- The name to modifyvalue- The value- Returns:
this
-
setInt
Description copied from interface:HeadersSet thenametovalue. This will remove all previous values associated withname.- Specified by:
setIntin interfaceHeaders<CharSequence, CharSequence, Http2Headers>- Parameters:
name- The name to modifyvalue- The value- Returns:
this
-
setLong
Description copied from interface:HeadersSet thenametovalue. This will remove all previous values associated withname.- Specified by:
setLongin interfaceHeaders<CharSequence, CharSequence, Http2Headers>- Parameters:
name- The name to modifyvalue- The value- Returns:
this
-
setFloat
Description copied from interface:HeadersSet thenametovalue. This will remove all previous values associated withname.- Specified by:
setFloatin interfaceHeaders<CharSequence, CharSequence, Http2Headers>- Parameters:
name- The name to modifyvalue- The value- Returns:
this
-
setDouble
Description copied from interface:HeadersSet thenametovalue. This will remove all previous values associated withname.- Specified by:
setDoublein interfaceHeaders<CharSequence, CharSequence, Http2Headers>- Parameters:
name- The name to modifyvalue- The value- Returns:
this
-
setTimeMillis
Description copied from interface:HeadersSet thenametovalue. This will remove all previous values associated withname.- Specified by:
setTimeMillisin interfaceHeaders<CharSequence, CharSequence, Http2Headers>- Parameters:
name- The name to modifyvalue- The value- Returns:
this
-
set
Description copied from interface:HeadersClears the current header entries and copies all header entries of the specifiedheaders.- Specified by:
setin interfaceHeaders<CharSequence, CharSequence, Http2Headers>- Returns:
this
-
setAll
Description copied from interface:HeadersRetains all current headers but callsHeaders.set(K, V)for each entry inheaders.- Specified by:
setAllin interfaceHeaders<CharSequence, CharSequence, Http2Headers>- Parameters:
headers- The headers used toHeaders.set(K, V)values in this instance- Returns:
this
-
remove
Description copied from interface:HeadersRemoves all headers with the specifiedname.- Specified by:
removein interfaceHeaders<CharSequence, CharSequence, Http2Headers>- Parameters:
name- the header name- Returns:
trueif at least one entry has been removed.
-
clear
Description copied from interface:HeadersRemoves all headers. After a call to this methodHeaders.size()equals0.- Specified by:
clearin interfaceHeaders<CharSequence, CharSequence, Http2Headers>- Returns:
this
-
iterator
Description copied from interface:Http2HeadersReturns an iterator over all HTTP/2 headers. The iteration order is as follows: 1. All pseudo headers (order not specified). 2. All non-pseudo headers (in insertion order).- Specified by:
iteratorin interfaceHeaders<CharSequence, CharSequence, Http2Headers>- Specified by:
iteratorin interfaceHttp2Headers- Specified by:
iteratorin interfaceIterable<Map.Entry<CharSequence, CharSequence>>
-
valueIterator
Description copied from interface:Http2HeadersEquivalent toHeaders.getAll(Object)but no intermediate list is generated.- Specified by:
valueIteratorin interfaceHttp2Headers- Parameters:
name- the name of the header to retrieve- Returns:
- an
Iteratorof header values corresponding toname.
-
method
Description copied from interface:Http2HeadersSets theHttp2Headers.PseudoHeaderName.METHODheader- Specified by:
methodin interfaceHttp2Headers
-
scheme
Description copied from interface:Http2HeadersSets theHttp2Headers.PseudoHeaderName.SCHEMEheader- Specified by:
schemein interfaceHttp2Headers
-
authority
Description copied from interface:Http2HeadersSets theHttp2Headers.PseudoHeaderName.AUTHORITYheader- Specified by:
authorityin interfaceHttp2Headers
-
path
Description copied from interface:Http2HeadersSets theHttp2Headers.PseudoHeaderName.PATHheader- Specified by:
pathin interfaceHttp2Headers
-
status
Description copied from interface:Http2HeadersSets theHttp2Headers.PseudoHeaderName.STATUSheader- Specified by:
statusin interfaceHttp2Headers
-
method
Description copied from interface:Http2HeadersGets theHttp2Headers.PseudoHeaderName.METHODheader ornullif there is no such header- Specified by:
methodin interfaceHttp2Headers
-
scheme
Description copied from interface:Http2HeadersGets theHttp2Headers.PseudoHeaderName.SCHEMEheader ornullif there is no such header- Specified by:
schemein interfaceHttp2Headers
-
authority
Description copied from interface:Http2HeadersGets theHttp2Headers.PseudoHeaderName.AUTHORITYheader ornullif there is no such header- Specified by:
authorityin interfaceHttp2Headers
-
path
Description copied from interface:Http2HeadersGets theHttp2Headers.PseudoHeaderName.PATHheader ornullif there is no such header- Specified by:
pathin interfaceHttp2Headers
-
status
Description copied from interface:Http2HeadersGets theHttp2Headers.PseudoHeaderName.STATUSheader ornullif there is no such header- Specified by:
statusin interfaceHttp2Headers
-
contains
Description copied from interface:Http2HeadersReturnstrueif a header with thenameandvalueexists,falseotherwise.If
caseInsensitiveistruethen a case insensitive compare is done on the value.- Specified by:
containsin interfaceHttp2Headers- Parameters:
name- the name of the header to findvalue- the value of the header to findcaseInsensitive-truethen a case insensitive compare is run to compare values. otherwise a case sensitive compare is run to compare values.
-
toString
-