Class ReadOnlyHttp2Headers
- java.lang.Object
-
- io.netty.handler.codec.http2.ReadOnlyHttp2Headers
-
- All Implemented Interfaces:
Headers<java.lang.CharSequence,java.lang.CharSequence,Http2Headers>,Http2Headers,java.lang.Iterable<java.util.Map.Entry<java.lang.CharSequence,java.lang.CharSequence>>
public final class ReadOnlyHttp2Headers extends java.lang.Object implements Http2Headers
A variant ofHttp2Headerswhich 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
DefaultHttp2Headersif your have a fixed set of headers which will not change.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface io.netty.handler.codec.http2.Http2Headers
Http2Headers.PseudoHeaderName
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description Http2Headersadd(Headers<? extends java.lang.CharSequence,? extends java.lang.CharSequence,?> headers)Adds all header names and values ofheadersto this object.Http2Headersadd(java.lang.CharSequence name, java.lang.CharSequence value)Adds a new header with the specifiednameandvalue.Http2Headersadd(java.lang.CharSequence name, java.lang.CharSequence... values)Adds new headers with the specifiednameandvalues.Http2Headersadd(java.lang.CharSequence name, java.lang.Iterable<? extends java.lang.CharSequence> values)Adds new headers with the specifiednameandvalues.Http2HeadersaddBoolean(java.lang.CharSequence name, boolean value)Adds a new header.Http2HeadersaddByte(java.lang.CharSequence name, byte value)Adds a new header.Http2HeadersaddChar(java.lang.CharSequence name, char value)Adds a new header.Http2HeadersaddDouble(java.lang.CharSequence name, double value)Adds a new header.Http2HeadersaddFloat(java.lang.CharSequence name, float value)Adds a new header.Http2HeadersaddInt(java.lang.CharSequence name, int value)Adds a new header.Http2HeadersaddLong(java.lang.CharSequence name, long value)Adds a new header.Http2HeadersaddObject(java.lang.CharSequence name, java.lang.Iterable<?> values)Adds a new header with the specified name and values.Http2HeadersaddObject(java.lang.CharSequence name, java.lang.Object value)Adds a new header.Http2HeadersaddObject(java.lang.CharSequence name, java.lang.Object... values)Adds a new header with the specified name and values.Http2HeadersaddShort(java.lang.CharSequence name, short value)Adds a new header.Http2HeadersaddTimeMillis(java.lang.CharSequence name, long value)Adds a new header.java.lang.CharSequenceauthority()Gets theHttp2Headers.PseudoHeaderName.AUTHORITYheader ornullif there is no such headerHttp2Headersauthority(java.lang.CharSequence value)Sets theHttp2Headers.PseudoHeaderName.AUTHORITYheaderHttp2Headersclear()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(java.lang.CharSequence name)Returnstrueif a header with thenameexists,falseotherwise.booleancontains(java.lang.CharSequence name, java.lang.CharSequence value)Returnstrueif a header with thenameandvalueexists,falseotherwise.booleancontains(java.lang.CharSequence name, java.lang.CharSequence value, boolean caseInsensitive)Returnstrueif a header with thenameandvalueexists,falseotherwise.booleancontainsBoolean(java.lang.CharSequence name, boolean value)Returnstrueif a header with the name and value exists.booleancontainsByte(java.lang.CharSequence name, byte value)Returnstrueif a header with the name and value exists.booleancontainsChar(java.lang.CharSequence name, char value)Returnstrueif a header with the name and value exists.booleancontainsDouble(java.lang.CharSequence name, double value)Returnstrueif a header with the name and value exists.booleancontainsFloat(java.lang.CharSequence name, float value)Returnstrueif a header with the name and value exists.booleancontainsInt(java.lang.CharSequence name, int value)Returnstrueif a header with the name and value exists.booleancontainsLong(java.lang.CharSequence name, long value)Returnstrueif a header with the name and value exists.booleancontainsObject(java.lang.CharSequence name, java.lang.Object value)Returnstrueif a header with the name and value exists.booleancontainsShort(java.lang.CharSequence name, short value)Returnstrueif a header with the name and value exists.booleancontainsTimeMillis(java.lang.CharSequence name, long value)Returnstrueif a header with the name and value exists.java.lang.CharSequenceget(java.lang.CharSequence name)Returns the value of a header with the specified name.java.lang.CharSequenceget(java.lang.CharSequence name, java.lang.CharSequence defaultValue)Returns the value of a header with the specified name.java.util.List<java.lang.CharSequence>getAll(java.lang.CharSequence name)Returns all values for the header with the specified name.java.util.List<java.lang.CharSequence>getAllAndRemove(java.lang.CharSequence name)Returns all values for the header with the specified name and removes them from this object.java.lang.CharSequencegetAndRemove(java.lang.CharSequence name)Returns the value of a header with the specified name and removes it from this object.java.lang.CharSequencegetAndRemove(java.lang.CharSequence name, java.lang.CharSequence defaultValue)Returns the value of a header with the specified name and removes it from this object.java.lang.BooleangetBoolean(java.lang.CharSequence name)Returns thebooleanvalue of a header with the specified name.booleangetBoolean(java.lang.CharSequence name, boolean defaultValue)Returns thebooleanvalue of a header with the specified name.java.lang.BooleangetBooleanAndRemove(java.lang.CharSequence name)Returns thebooleanvalue of a header with the specifiednameand removes the header from this object.booleangetBooleanAndRemove(java.lang.CharSequence name, boolean defaultValue)Returns thebooleanvalue of a header with the specifiednameand removes the header from this object.java.lang.BytegetByte(java.lang.CharSequence name)Returns thebytevalue of a header with the specified name.bytegetByte(java.lang.CharSequence name, byte defaultValue)Returns thebytevalue of a header with the specified name.java.lang.BytegetByteAndRemove(java.lang.CharSequence name)Returns thebytevalue of a header with the specifiednameand removes the header from this object.bytegetByteAndRemove(java.lang.CharSequence name, byte defaultValue)Returns thebytevalue of a header with the specifiednameand removes the header from this object.java.lang.CharactergetChar(java.lang.CharSequence name)Returns thecharvalue of a header with the specified name.chargetChar(java.lang.CharSequence name, char defaultValue)Returns thecharvalue of a header with the specified name.java.lang.CharactergetCharAndRemove(java.lang.CharSequence name)Returns thecharvalue of a header with the specifiednameand removes the header from this object.chargetCharAndRemove(java.lang.CharSequence name, char defaultValue)Returns thecharvalue of a header with the specifiednameand removes the header from this object.java.lang.DoublegetDouble(java.lang.CharSequence name)Returns thedoublevalue of a header with the specified name.doublegetDouble(java.lang.CharSequence name, double defaultValue)Returns thedoublevalue of a header with the specified name.java.lang.DoublegetDoubleAndRemove(java.lang.CharSequence name)Returns thedoublevalue of a header with the specifiednameand removes the header from this object.doublegetDoubleAndRemove(java.lang.CharSequence name, double defaultValue)Returns thedoublevalue of a header with the specifiednameand removes the header from this object.java.lang.FloatgetFloat(java.lang.CharSequence name)Returns thefloatvalue of a header with the specified name.floatgetFloat(java.lang.CharSequence name, float defaultValue)Returns thefloatvalue of a header with the specified name.java.lang.FloatgetFloatAndRemove(java.lang.CharSequence name)Returns thefloatvalue of a header with the specifiednameand removes the header from this object.floatgetFloatAndRemove(java.lang.CharSequence name, float defaultValue)Returns thefloatvalue of a header with the specifiednameand removes the header from this object.java.lang.IntegergetInt(java.lang.CharSequence name)Returns theintvalue of a header with the specified name.intgetInt(java.lang.CharSequence name, int defaultValue)Returns theintvalue of a header with the specified name.java.lang.IntegergetIntAndRemove(java.lang.CharSequence name)Returns theintvalue of a header with the specifiednameand removes the header from this object.intgetIntAndRemove(java.lang.CharSequence name, int defaultValue)Returns theintvalue of a header with the specifiednameand removes the header from this object.java.lang.LonggetLong(java.lang.CharSequence name)Returns thelongvalue of a header with the specified name.longgetLong(java.lang.CharSequence name, long defaultValue)Returns thelongvalue of a header with the specified name.java.lang.LonggetLongAndRemove(java.lang.CharSequence name)Returns thelongvalue of a header with the specifiednameand removes the header from this object.longgetLongAndRemove(java.lang.CharSequence name, long defaultValue)Returns thelongvalue of a header with the specifiednameand removes the header from this object.java.lang.ShortgetShort(java.lang.CharSequence name)Returns theshortvalue of a header with the specified name.shortgetShort(java.lang.CharSequence name, short defaultValue)Returns theshortvalue of a header with the specified name.java.lang.ShortgetShortAndRemove(java.lang.CharSequence name)Returns theshortvalue of a header with the specifiednameand removes the header from this object.shortgetShortAndRemove(java.lang.CharSequence name, short defaultValue)Returns theshortvalue of a header with the specifiednameand removes the header from this object.java.lang.LonggetTimeMillis(java.lang.CharSequence name)Returns the value of a header with the specified name in milliseconds.longgetTimeMillis(java.lang.CharSequence name, long defaultValue)Returns the value of a header with the specified name in milliseconds.java.lang.LonggetTimeMillisAndRemove(java.lang.CharSequence name)Returns the value of a header with the specifiednamein milliseconds and removes the header from this object.longgetTimeMillisAndRemove(java.lang.CharSequence name, long defaultValue)Returns the value of a header with the specifiednamein milliseconds and removes the header from this object.booleanisEmpty()java.util.Iterator<java.util.Map.Entry<java.lang.CharSequence,java.lang.CharSequence>>iterator()Returns an iterator over all HTTP/2 headers.java.lang.CharSequencemethod()Gets theHttp2Headers.PseudoHeaderName.METHODheader ornullif there is no such headerHttp2Headersmethod(java.lang.CharSequence value)Sets theHttp2Headers.PseudoHeaderName.METHODheaderjava.util.Set<java.lang.CharSequence>names()Returns aSetof all header names in this object.java.lang.CharSequencepath()Gets theHttp2Headers.PseudoHeaderName.PATHheader ornullif there is no such headerHttp2Headerspath(java.lang.CharSequence value)Sets theHttp2Headers.PseudoHeaderName.PATHheaderbooleanremove(java.lang.CharSequence name)Removes all headers with the specifiedname.java.lang.CharSequencescheme()Gets theHttp2Headers.PseudoHeaderName.SCHEMEheader ornullif there is no such headerHttp2Headersscheme(java.lang.CharSequence value)Sets theHttp2Headers.PseudoHeaderName.SCHEMEheaderstatic ReadOnlyHttp2HeadersserverHeaders(boolean validateHeaders, AsciiString status, AsciiString... otherHeaders)Create a new read only representation of headers used by servers.Http2Headersset(Headers<? extends java.lang.CharSequence,? extends java.lang.CharSequence,?> headers)Clears the current header entries and copies all header entries of the specifiedheaders.Http2Headersset(java.lang.CharSequence name, java.lang.CharSequence value)Sets a header with the specified name and value.Http2Headersset(java.lang.CharSequence name, java.lang.CharSequence... values)Sets a header with the specified name and values.Http2Headersset(java.lang.CharSequence name, java.lang.Iterable<? extends java.lang.CharSequence> values)Sets a new header with the specified name and values.Http2HeaderssetAll(Headers<? extends java.lang.CharSequence,? extends java.lang.CharSequence,?> headers)Retains all current headers but calls#set(K, V)for each entry inheaders.Http2HeaderssetBoolean(java.lang.CharSequence name, boolean value)Set thenametovalue.Http2HeaderssetByte(java.lang.CharSequence name, byte value)Set thenametovalue.Http2HeaderssetChar(java.lang.CharSequence name, char value)Set thenametovalue.Http2HeaderssetDouble(java.lang.CharSequence name, double value)Set thenametovalue.Http2HeaderssetFloat(java.lang.CharSequence name, float value)Set thenametovalue.Http2HeaderssetInt(java.lang.CharSequence name, int value)Set thenametovalue.Http2HeaderssetLong(java.lang.CharSequence name, long value)Set thenametovalue.Http2HeaderssetObject(java.lang.CharSequence name, java.lang.Iterable<?> values)Sets a header with the specified name and values.Http2HeaderssetObject(java.lang.CharSequence name, java.lang.Object value)Sets a new header.Http2HeaderssetObject(java.lang.CharSequence name, java.lang.Object... values)Sets a header with the specified name and values.Http2HeaderssetShort(java.lang.CharSequence name, short value)Set thenametovalue.Http2HeaderssetTimeMillis(java.lang.CharSequence name, long value)Set thenametovalue.intsize()Returns the number of headers in this object.java.lang.CharSequencestatus()Gets theHttp2Headers.PseudoHeaderName.STATUSheader ornullif there is no such headerHttp2Headersstatus(java.lang.CharSequence value)Sets theHttp2Headers.PseudoHeaderName.STATUSheaderjava.lang.StringtoString()static ReadOnlyHttp2Headerstrailers(boolean validateHeaders, AsciiString... otherHeaders)Used to create read only object designed to represent trailers.java.util.Iterator<java.lang.CharSequence>valueIterator(java.lang.CharSequence name)Equivalent toHeaders.getAll(Object)but no intermediate list is generated.
-
-
-
Method Detail
-
trailers
public static ReadOnlyHttp2Headers trailers(boolean validateHeaders, AsciiString... otherHeaders)
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
public java.lang.CharSequence get(java.lang.CharSequence name)
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<java.lang.CharSequence,java.lang.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
public java.lang.CharSequence get(java.lang.CharSequence name, java.lang.CharSequence defaultValue)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<java.lang.CharSequence,java.lang.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
public java.lang.CharSequence getAndRemove(java.lang.CharSequence name)
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<java.lang.CharSequence,java.lang.CharSequence,Http2Headers>- Parameters:
name- the name of the header to retrieve- Returns:
- the first header value or
nullif there is no such header
-
getAndRemove
public java.lang.CharSequence getAndRemove(java.lang.CharSequence name, java.lang.CharSequence defaultValue)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<java.lang.CharSequence,java.lang.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
public java.util.List<java.lang.CharSequence> getAll(java.lang.CharSequence name)
Description copied from interface:HeadersReturns all values for the header with the specified name. The returnedListcan't be modified.- Specified by:
getAllin interfaceHeaders<java.lang.CharSequence,java.lang.CharSequence,Http2Headers>- Parameters:
name- the name of the header to retrieve- Returns:
- a
Listof header values or an emptyListif no values are found.
-
getAllAndRemove
public java.util.List<java.lang.CharSequence> getAllAndRemove(java.lang.CharSequence name)
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<java.lang.CharSequence,java.lang.CharSequence,Http2Headers>- Parameters:
name- the name of the header to retrieve- Returns:
- a
Listof header values or an emptyListif no values are found.
-
getBoolean
public java.lang.Boolean getBoolean(java.lang.CharSequence name)
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<java.lang.CharSequence,java.lang.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
public boolean getBoolean(java.lang.CharSequence name, boolean defaultValue)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<java.lang.CharSequence,java.lang.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
public java.lang.Byte getByte(java.lang.CharSequence name)
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<java.lang.CharSequence,java.lang.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
public byte getByte(java.lang.CharSequence name, byte defaultValue)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<java.lang.CharSequence,java.lang.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
public java.lang.Character getChar(java.lang.CharSequence name)
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<java.lang.CharSequence,java.lang.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
public char getChar(java.lang.CharSequence name, char defaultValue)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<java.lang.CharSequence,java.lang.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
public java.lang.Short getShort(java.lang.CharSequence name)
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<java.lang.CharSequence,java.lang.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
public short getShort(java.lang.CharSequence name, short defaultValue)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<java.lang.CharSequence,java.lang.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
public java.lang.Integer getInt(java.lang.CharSequence name)
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<java.lang.CharSequence,java.lang.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
public int getInt(java.lang.CharSequence name, int defaultValue)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<java.lang.CharSequence,java.lang.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
public java.lang.Long getLong(java.lang.CharSequence name)
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<java.lang.CharSequence,java.lang.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
public long getLong(java.lang.CharSequence name, long defaultValue)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<java.lang.CharSequence,java.lang.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
public java.lang.Float getFloat(java.lang.CharSequence name)
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<java.lang.CharSequence,java.lang.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
public float getFloat(java.lang.CharSequence name, float defaultValue)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<java.lang.CharSequence,java.lang.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
public java.lang.Double getDouble(java.lang.CharSequence name)
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<java.lang.CharSequence,java.lang.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
public double getDouble(java.lang.CharSequence name, double defaultValue)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<java.lang.CharSequence,java.lang.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
public java.lang.Long getTimeMillis(java.lang.CharSequence name)
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<java.lang.CharSequence,java.lang.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
public long getTimeMillis(java.lang.CharSequence name, long defaultValue)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<java.lang.CharSequence,java.lang.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
public java.lang.Boolean getBooleanAndRemove(java.lang.CharSequence name)
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<java.lang.CharSequence,java.lang.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
public boolean getBooleanAndRemove(java.lang.CharSequence name, boolean defaultValue)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<java.lang.CharSequence,java.lang.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
public java.lang.Byte getByteAndRemove(java.lang.CharSequence name)
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<java.lang.CharSequence,java.lang.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
public byte getByteAndRemove(java.lang.CharSequence name, byte defaultValue)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<java.lang.CharSequence,java.lang.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
public java.lang.Character getCharAndRemove(java.lang.CharSequence name)
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<java.lang.CharSequence,java.lang.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
public char getCharAndRemove(java.lang.CharSequence name, char defaultValue)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<java.lang.CharSequence,java.lang.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
public java.lang.Short getShortAndRemove(java.lang.CharSequence name)
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<java.lang.CharSequence,java.lang.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
public short getShortAndRemove(java.lang.CharSequence name, short defaultValue)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<java.lang.CharSequence,java.lang.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
public java.lang.Integer getIntAndRemove(java.lang.CharSequence name)
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<java.lang.CharSequence,java.lang.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
public int getIntAndRemove(java.lang.CharSequence name, int defaultValue)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<java.lang.CharSequence,java.lang.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
public java.lang.Long getLongAndRemove(java.lang.CharSequence name)
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<java.lang.CharSequence,java.lang.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
public long getLongAndRemove(java.lang.CharSequence name, long defaultValue)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<java.lang.CharSequence,java.lang.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
public java.lang.Float getFloatAndRemove(java.lang.CharSequence name)
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<java.lang.CharSequence,java.lang.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
public float getFloatAndRemove(java.lang.CharSequence name, float defaultValue)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<java.lang.CharSequence,java.lang.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
public java.lang.Double getDoubleAndRemove(java.lang.CharSequence name)
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<java.lang.CharSequence,java.lang.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
public double getDoubleAndRemove(java.lang.CharSequence name, double defaultValue)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<java.lang.CharSequence,java.lang.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
public java.lang.Long getTimeMillisAndRemove(java.lang.CharSequence name)
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<java.lang.CharSequence,java.lang.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
public long getTimeMillisAndRemove(java.lang.CharSequence name, long defaultValue)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<java.lang.CharSequence,java.lang.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
public boolean contains(java.lang.CharSequence name)
Description copied from interface:HeadersReturnstrueif a header with thenameexists,falseotherwise.- Specified by:
containsin interfaceHeaders<java.lang.CharSequence,java.lang.CharSequence,Http2Headers>- Parameters:
name- the header name
-
contains
public boolean contains(java.lang.CharSequence name, java.lang.CharSequence value)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<java.lang.CharSequence,java.lang.CharSequence,Http2Headers>- Parameters:
name- the header namevalue- the header value of the header to find
-
containsObject
public boolean containsObject(java.lang.CharSequence name, java.lang.Object value)Description copied from interface:HeadersReturnstrueif a header with the name and value exists.- Specified by:
containsObjectin interfaceHeaders<java.lang.CharSequence,java.lang.CharSequence,Http2Headers>- Parameters:
name- the header namevalue- the header value- Returns:
trueif it contains itfalseotherwise
-
containsBoolean
public boolean containsBoolean(java.lang.CharSequence name, boolean value)Description copied from interface:HeadersReturnstrueif a header with the name and value exists.- Specified by:
containsBooleanin interfaceHeaders<java.lang.CharSequence,java.lang.CharSequence,Http2Headers>- Parameters:
name- the header namevalue- the header value- Returns:
trueif it contains itfalseotherwise
-
containsByte
public boolean containsByte(java.lang.CharSequence name, byte value)Description copied from interface:HeadersReturnstrueif a header with the name and value exists.- Specified by:
containsBytein interfaceHeaders<java.lang.CharSequence,java.lang.CharSequence,Http2Headers>- Parameters:
name- the header namevalue- the header value- Returns:
trueif it contains itfalseotherwise
-
containsChar
public boolean containsChar(java.lang.CharSequence name, char value)Description copied from interface:HeadersReturnstrueif a header with the name and value exists.- Specified by:
containsCharin interfaceHeaders<java.lang.CharSequence,java.lang.CharSequence,Http2Headers>- Parameters:
name- the header namevalue- the header value- Returns:
trueif it contains itfalseotherwise
-
containsShort
public boolean containsShort(java.lang.CharSequence name, short value)Description copied from interface:HeadersReturnstrueif a header with the name and value exists.- Specified by:
containsShortin interfaceHeaders<java.lang.CharSequence,java.lang.CharSequence,Http2Headers>- Parameters:
name- the header namevalue- the header value- Returns:
trueif it contains itfalseotherwise
-
containsInt
public boolean containsInt(java.lang.CharSequence name, int value)Description copied from interface:HeadersReturnstrueif a header with the name and value exists.- Specified by:
containsIntin interfaceHeaders<java.lang.CharSequence,java.lang.CharSequence,Http2Headers>- Parameters:
name- the header namevalue- the header value- Returns:
trueif it contains itfalseotherwise
-
containsLong
public boolean containsLong(java.lang.CharSequence name, long value)Description copied from interface:HeadersReturnstrueif a header with the name and value exists.- Specified by:
containsLongin interfaceHeaders<java.lang.CharSequence,java.lang.CharSequence,Http2Headers>- Parameters:
name- the header namevalue- the header value- Returns:
trueif it contains itfalseotherwise
-
containsFloat
public boolean containsFloat(java.lang.CharSequence name, float value)Description copied from interface:HeadersReturnstrueif a header with the name and value exists.- Specified by:
containsFloatin interfaceHeaders<java.lang.CharSequence,java.lang.CharSequence,Http2Headers>- Parameters:
name- the header namevalue- the header value- Returns:
trueif it contains itfalseotherwise
-
containsDouble
public boolean containsDouble(java.lang.CharSequence name, double value)Description copied from interface:HeadersReturnstrueif a header with the name and value exists.- Specified by:
containsDoublein interfaceHeaders<java.lang.CharSequence,java.lang.CharSequence,Http2Headers>- Parameters:
name- the header namevalue- the header value- Returns:
trueif it contains itfalseotherwise
-
containsTimeMillis
public boolean containsTimeMillis(java.lang.CharSequence name, long value)Description copied from interface:HeadersReturnstrueif a header with the name and value exists.- Specified by:
containsTimeMillisin interfaceHeaders<java.lang.CharSequence,java.lang.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<java.lang.CharSequence,java.lang.CharSequence,Http2Headers>
-
isEmpty
public boolean isEmpty()
Description copied from interface:Headers- Specified by:
isEmptyin interfaceHeaders<java.lang.CharSequence,java.lang.CharSequence,Http2Headers>
-
names
public java.util.Set<java.lang.CharSequence> names()
Description copied from interface:HeadersReturns aSetof all header names in this object. The returnedSetcannot be modified.- Specified by:
namesin interfaceHeaders<java.lang.CharSequence,java.lang.CharSequence,Http2Headers>
-
add
public Http2Headers add(java.lang.CharSequence name, java.lang.CharSequence value)
Description copied from interface:HeadersAdds a new header with the specifiednameandvalue.- Specified by:
addin interfaceHeaders<java.lang.CharSequence,java.lang.CharSequence,Http2Headers>- Parameters:
name- the name of the headervalue- the value of the header- Returns:
this
-
add
public Http2Headers add(java.lang.CharSequence name, java.lang.Iterable<? extends java.lang.CharSequence> values)
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<java.lang.CharSequence,java.lang.CharSequence,Http2Headers>- Parameters:
name- the header namevalues- the values of the header- Returns:
this
-
add
public Http2Headers add(java.lang.CharSequence name, java.lang.CharSequence... values)
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<java.lang.CharSequence,java.lang.CharSequence,Http2Headers>- Parameters:
name- the header namevalues- the values of the header- Returns:
this
-
addObject
public Http2Headers addObject(java.lang.CharSequence name, java.lang.Object value)
Description copied from interface:HeadersAdds a new header. Before thevalueis added, it's converted to typeT.- Specified by:
addObjectin interfaceHeaders<java.lang.CharSequence,java.lang.CharSequence,Http2Headers>- Parameters:
name- the header namevalue- the value of the header- Returns:
this
-
addObject
public Http2Headers addObject(java.lang.CharSequence name, java.lang.Iterable<?> values)
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<java.lang.CharSequence,java.lang.CharSequence,Http2Headers>- Parameters:
name- the header namevalues- the value of the header- Returns:
this
-
addObject
public Http2Headers addObject(java.lang.CharSequence name, java.lang.Object... values)
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<java.lang.CharSequence,java.lang.CharSequence,Http2Headers>- Parameters:
name- the header namevalues- the value of the header- Returns:
this
-
addBoolean
public Http2Headers addBoolean(java.lang.CharSequence name, boolean value)
Description copied from interface:HeadersAdds a new header.- Specified by:
addBooleanin interfaceHeaders<java.lang.CharSequence,java.lang.CharSequence,Http2Headers>- Parameters:
name- the header namevalue- the value of the header- Returns:
this
-
addByte
public Http2Headers addByte(java.lang.CharSequence name, byte value)
Description copied from interface:HeadersAdds a new header.- Specified by:
addBytein interfaceHeaders<java.lang.CharSequence,java.lang.CharSequence,Http2Headers>- Parameters:
name- the header namevalue- the value of the header- Returns:
this
-
addChar
public Http2Headers addChar(java.lang.CharSequence name, char value)
Description copied from interface:HeadersAdds a new header.- Specified by:
addCharin interfaceHeaders<java.lang.CharSequence,java.lang.CharSequence,Http2Headers>- Parameters:
name- the header namevalue- the value of the header- Returns:
this
-
addShort
public Http2Headers addShort(java.lang.CharSequence name, short value)
Description copied from interface:HeadersAdds a new header.- Specified by:
addShortin interfaceHeaders<java.lang.CharSequence,java.lang.CharSequence,Http2Headers>- Parameters:
name- the header namevalue- the value of the header- Returns:
this
-
addInt
public Http2Headers addInt(java.lang.CharSequence name, int value)
Description copied from interface:HeadersAdds a new header.- Specified by:
addIntin interfaceHeaders<java.lang.CharSequence,java.lang.CharSequence,Http2Headers>- Parameters:
name- the header namevalue- the value of the header- Returns:
this
-
addLong
public Http2Headers addLong(java.lang.CharSequence name, long value)
Description copied from interface:HeadersAdds a new header.- Specified by:
addLongin interfaceHeaders<java.lang.CharSequence,java.lang.CharSequence,Http2Headers>- Parameters:
name- the header namevalue- the value of the header- Returns:
this
-
addFloat
public Http2Headers addFloat(java.lang.CharSequence name, float value)
Description copied from interface:HeadersAdds a new header.- Specified by:
addFloatin interfaceHeaders<java.lang.CharSequence,java.lang.CharSequence,Http2Headers>- Parameters:
name- the header namevalue- the value of the header- Returns:
this
-
addDouble
public Http2Headers addDouble(java.lang.CharSequence name, double value)
Description copied from interface:HeadersAdds a new header.- Specified by:
addDoublein interfaceHeaders<java.lang.CharSequence,java.lang.CharSequence,Http2Headers>- Parameters:
name- the header namevalue- the value of the header- Returns:
this
-
addTimeMillis
public Http2Headers addTimeMillis(java.lang.CharSequence name, long value)
Description copied from interface:HeadersAdds a new header.- Specified by:
addTimeMillisin interfaceHeaders<java.lang.CharSequence,java.lang.CharSequence,Http2Headers>- Parameters:
name- the header namevalue- the value of the header- Returns:
this
-
add
public Http2Headers add(Headers<? extends java.lang.CharSequence,? extends java.lang.CharSequence,?> headers)
Description copied from interface:HeadersAdds all header names and values ofheadersto this object.- Specified by:
addin interfaceHeaders<java.lang.CharSequence,java.lang.CharSequence,Http2Headers>- Returns:
this
-
set
public Http2Headers set(java.lang.CharSequence name, java.lang.CharSequence value)
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<java.lang.CharSequence,java.lang.CharSequence,Http2Headers>- Parameters:
name- the header namevalue- the value of the header- Returns:
this
-
set
public Http2Headers set(java.lang.CharSequence name, java.lang.Iterable<? extends java.lang.CharSequence> values)
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<java.lang.CharSequence,java.lang.CharSequence,Http2Headers>- Parameters:
name- the header namevalues- the value of the header- Returns:
this
-
set
public Http2Headers set(java.lang.CharSequence name, java.lang.CharSequence... values)
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<java.lang.CharSequence,java.lang.CharSequence,Http2Headers>- Parameters:
name- the header namevalues- the value of the header- Returns:
this
-
setObject
public Http2Headers setObject(java.lang.CharSequence name, java.lang.Object value)
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<java.lang.CharSequence,java.lang.CharSequence,Http2Headers>- Parameters:
name- the header namevalue- the value of the header- Returns:
this
-
setObject
public Http2Headers setObject(java.lang.CharSequence name, java.lang.Iterable<?> values)
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<java.lang.CharSequence,java.lang.CharSequence,Http2Headers>- Parameters:
name- the header namevalues- the values of the header- Returns:
this
-
setObject
public Http2Headers setObject(java.lang.CharSequence name, java.lang.Object... values)
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<java.lang.CharSequence,java.lang.CharSequence,Http2Headers>- Parameters:
name- the header namevalues- the values of the header- Returns:
this
-
setBoolean
public Http2Headers setBoolean(java.lang.CharSequence name, boolean value)
Description copied from interface:HeadersSet thenametovalue. This will remove all previous values associated withname.- Specified by:
setBooleanin interfaceHeaders<java.lang.CharSequence,java.lang.CharSequence,Http2Headers>- Parameters:
name- The name to modifyvalue- The value- Returns:
this
-
setByte
public Http2Headers setByte(java.lang.CharSequence name, byte value)
Description copied from interface:HeadersSet thenametovalue. This will remove all previous values associated withname.- Specified by:
setBytein interfaceHeaders<java.lang.CharSequence,java.lang.CharSequence,Http2Headers>- Parameters:
name- The name to modifyvalue- The value- Returns:
this
-
setChar
public Http2Headers setChar(java.lang.CharSequence name, char value)
Description copied from interface:HeadersSet thenametovalue. This will remove all previous values associated withname.- Specified by:
setCharin interfaceHeaders<java.lang.CharSequence,java.lang.CharSequence,Http2Headers>- Parameters:
name- The name to modifyvalue- The value- Returns:
this
-
setShort
public Http2Headers setShort(java.lang.CharSequence name, short value)
Description copied from interface:HeadersSet thenametovalue. This will remove all previous values associated withname.- Specified by:
setShortin interfaceHeaders<java.lang.CharSequence,java.lang.CharSequence,Http2Headers>- Parameters:
name- The name to modifyvalue- The value- Returns:
this
-
setInt
public Http2Headers setInt(java.lang.CharSequence name, int value)
Description copied from interface:HeadersSet thenametovalue. This will remove all previous values associated withname.- Specified by:
setIntin interfaceHeaders<java.lang.CharSequence,java.lang.CharSequence,Http2Headers>- Parameters:
name- The name to modifyvalue- The value- Returns:
this
-
setLong
public Http2Headers setLong(java.lang.CharSequence name, long value)
Description copied from interface:HeadersSet thenametovalue. This will remove all previous values associated withname.- Specified by:
setLongin interfaceHeaders<java.lang.CharSequence,java.lang.CharSequence,Http2Headers>- Parameters:
name- The name to modifyvalue- The value- Returns:
this
-
setFloat
public Http2Headers setFloat(java.lang.CharSequence name, float value)
Description copied from interface:HeadersSet thenametovalue. This will remove all previous values associated withname.- Specified by:
setFloatin interfaceHeaders<java.lang.CharSequence,java.lang.CharSequence,Http2Headers>- Parameters:
name- The name to modifyvalue- The value- Returns:
this
-
setDouble
public Http2Headers setDouble(java.lang.CharSequence name, double value)
Description copied from interface:HeadersSet thenametovalue. This will remove all previous values associated withname.- Specified by:
setDoublein interfaceHeaders<java.lang.CharSequence,java.lang.CharSequence,Http2Headers>- Parameters:
name- The name to modifyvalue- The value- Returns:
this
-
setTimeMillis
public Http2Headers setTimeMillis(java.lang.CharSequence name, long value)
Description copied from interface:HeadersSet thenametovalue. This will remove all previous values associated withname.- Specified by:
setTimeMillisin interfaceHeaders<java.lang.CharSequence,java.lang.CharSequence,Http2Headers>- Parameters:
name- The name to modifyvalue- The value- Returns:
this
-
set
public Http2Headers set(Headers<? extends java.lang.CharSequence,? extends java.lang.CharSequence,?> headers)
Description copied from interface:HeadersClears the current header entries and copies all header entries of the specifiedheaders.- Specified by:
setin interfaceHeaders<java.lang.CharSequence,java.lang.CharSequence,Http2Headers>- Returns:
this
-
setAll
public Http2Headers setAll(Headers<? extends java.lang.CharSequence,? extends java.lang.CharSequence,?> headers)
Description copied from interface:HeadersRetains all current headers but calls#set(K, V)for each entry inheaders.- Specified by:
setAllin interfaceHeaders<java.lang.CharSequence,java.lang.CharSequence,Http2Headers>- Parameters:
headers- The headers used to#set(K, V)values in this instance- Returns:
this
-
remove
public boolean remove(java.lang.CharSequence name)
Description copied from interface:HeadersRemoves all headers with the specifiedname.- Specified by:
removein interfaceHeaders<java.lang.CharSequence,java.lang.CharSequence,Http2Headers>- Parameters:
name- the header name- Returns:
trueif at least one entry has been removed.
-
clear
public Http2Headers clear()
Description copied from interface:HeadersRemoves all headers. After a call to this methodHeaders.size()equals0.- Specified by:
clearin interfaceHeaders<java.lang.CharSequence,java.lang.CharSequence,Http2Headers>- Returns:
this
-
iterator
public java.util.Iterator<java.util.Map.Entry<java.lang.CharSequence,java.lang.CharSequence>> 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<java.lang.CharSequence,java.lang.CharSequence,Http2Headers>- Specified by:
iteratorin interfaceHttp2Headers- Specified by:
iteratorin interfacejava.lang.Iterable<java.util.Map.Entry<java.lang.CharSequence,java.lang.CharSequence>>
-
valueIterator
public java.util.Iterator<java.lang.CharSequence> valueIterator(java.lang.CharSequence name)
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
public Http2Headers method(java.lang.CharSequence value)
Description copied from interface:Http2HeadersSets theHttp2Headers.PseudoHeaderName.METHODheader- Specified by:
methodin interfaceHttp2Headers
-
scheme
public Http2Headers scheme(java.lang.CharSequence value)
Description copied from interface:Http2HeadersSets theHttp2Headers.PseudoHeaderName.SCHEMEheader- Specified by:
schemein interfaceHttp2Headers
-
authority
public Http2Headers authority(java.lang.CharSequence value)
Description copied from interface:Http2HeadersSets theHttp2Headers.PseudoHeaderName.AUTHORITYheader- Specified by:
authorityin interfaceHttp2Headers
-
path
public Http2Headers path(java.lang.CharSequence value)
Description copied from interface:Http2HeadersSets theHttp2Headers.PseudoHeaderName.PATHheader- Specified by:
pathin interfaceHttp2Headers
-
status
public Http2Headers status(java.lang.CharSequence value)
Description copied from interface:Http2HeadersSets theHttp2Headers.PseudoHeaderName.STATUSheader- Specified by:
statusin interfaceHttp2Headers
-
method
public java.lang.CharSequence method()
Description copied from interface:Http2HeadersGets theHttp2Headers.PseudoHeaderName.METHODheader ornullif there is no such header- Specified by:
methodin interfaceHttp2Headers
-
scheme
public java.lang.CharSequence scheme()
Description copied from interface:Http2HeadersGets theHttp2Headers.PseudoHeaderName.SCHEMEheader ornullif there is no such header- Specified by:
schemein interfaceHttp2Headers
-
authority
public java.lang.CharSequence authority()
Description copied from interface:Http2HeadersGets theHttp2Headers.PseudoHeaderName.AUTHORITYheader ornullif there is no such header- Specified by:
authorityin interfaceHttp2Headers
-
path
public java.lang.CharSequence path()
Description copied from interface:Http2HeadersGets theHttp2Headers.PseudoHeaderName.PATHheader ornullif there is no such header- Specified by:
pathin interfaceHttp2Headers
-
status
public java.lang.CharSequence status()
Description copied from interface:Http2HeadersGets theHttp2Headers.PseudoHeaderName.STATUSheader ornullif there is no such header- Specified by:
statusin interfaceHttp2Headers
-
contains
public boolean contains(java.lang.CharSequence name, java.lang.CharSequence value, boolean caseInsensitive)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
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
-