Class DefaultHeadersImpl<K,V>
java.lang.Object
io.netty.handler.codec.DefaultHeaders<K, V, DefaultHeadersImpl<K,V>>
io.netty.handler.codec.DefaultHeadersImpl<K,V>
- Type Parameters:
K- the type of the header name.V- the type of the header value.
- All Implemented Interfaces:
Headers<K, V, DefaultHeadersImpl<K,V>>, Iterable<Map.Entry<K, V>>
A concrete implementation of
DefaultHeaders that allows for direct instantiation.-
Nested Class Summary
Nested classes/interfaces inherited from class DefaultHeaders
DefaultHeaders.HeaderEntry<K,V>, DefaultHeaders.NameValidator<K>, DefaultHeaders.ValueValidator<V> Modifier and TypeClassDescriptionprotected static classstatic interfacestatic interface -
Field Summary
Fields inherited from class DefaultHeaders
head -
Constructor Summary
ConstructorsConstructorDescriptionDefaultHeadersImpl(HashingStrategy<K> nameHashingStrategy, ValueConverter<V> valueConverter, DefaultHeaders.NameValidator<K> nameValidator) DefaultHeadersImpl(HashingStrategy<K> nameHashingStrategy, ValueConverter<V> valueConverter, DefaultHeaders.NameValidator<K> nameValidator, int arraySizeHint, DefaultHeaders.ValueValidator<V> valueValidator) -
Method Summary
Methods inherited from class DefaultHeaders
add, add, add, add, addBoolean, addByte, addChar, addDouble, addFloat, addImpl, addInt, addLong, addObject, addObject, addObject, addShort, addTimeMillis, clear, contains, contains, contains, containsBoolean, containsByte, containsChar, containsDouble, containsFloat, containsInt, containsLong, containsObject, containsShort, containsTimeMillis, copy, equals, equals, get, get, getAll, getAllAndRemove, getAndRemove, getAndRemove, getBoolean, getBoolean, getBooleanAndRemove, getBooleanAndRemove, getByte, getByte, getByteAndRemove, getByteAndRemove, getChar, getChar, getCharAndRemove, getCharAndRemove, getDouble, getDouble, getDoubleAndRemove, getDoubleAndRemove, getFloat, getFloat, getFloatAndRemove, getFloatAndRemove, getInt, getInt, getIntAndRemove, getIntAndRemove, getLong, getLong, getLongAndRemove, getLongAndRemove, getShort, getShort, getShortAndRemove, getShortAndRemove, getTimeMillis, getTimeMillis, getTimeMillisAndRemove, getTimeMillisAndRemove, hashCode, hashCode, isEmpty, iterator, names, nameValidator, newHeaderEntry, remove, set, set, set, set, setAll, setBoolean, setByte, setChar, setDouble, setFloat, setInt, setLong, setObject, setObject, setObject, setShort, setTimeMillis, size, toString, validateName, validateValue, valueConverter, valueIterator, valueValidatorModifier and TypeMethodDescriptionAdds all header names and values ofheadersto this object.Adds new headers with the specifiednameandvalues.Adds a new header with the specifiednameandvalue.Adds new headers with the specifiednameandvalues.addBoolean(K name, boolean value) Adds a new header.Adds a new header.Adds a new header.Adds a new header.Adds a new header.protected voidAdds a new header.Adds a new header.Adds a new header with the specified name and values.Adds a new header.Adds a new header with the specified name and values.Adds a new header.addTimeMillis(K name, long value) Adds a new header.clear()Removes all headers.booleanReturnstrueif a header with thenameexists,falseotherwise.booleanReturnstrueif a header with thenameandvalueexists,falseotherwise.final booleancontains(K name, V value, HashingStrategy<? super V> valueHashingStrategy) booleancontainsBoolean(K name, boolean value) Returnstrueif a header with the name and value exists.booleancontainsByte(K name, byte value) Returnstrueif a header with the name and value exists.booleancontainsChar(K name, char value) Returnstrueif a header with the name and value exists.booleancontainsDouble(K name, double value) Returnstrueif a header with the name and value exists.booleancontainsFloat(K name, float value) Returnstrueif a header with the name and value exists.booleancontainsInt(K name, int value) Returnstrueif a header with the name and value exists.booleancontainsLong(K name, long value) Returnstrueif a header with the name and value exists.booleancontainsObject(K name, Object value) Returnstrueif a header with the name and value exists.booleancontainsShort(K name, short value) Returnstrueif a header with the name and value exists.booleancontainsTimeMillis(K name, long value) Returnstrueif a header with the name and value exists.DefaultHeaders<K, V, DefaultHeadersImpl<K, V>> copy()Returns a deep copy of this instance.final booleanTest this object for equality againsth2.booleanReturns the value of a header with the specified name.Returns the value of a header with the specified name.Returns all values for the header with the specified name.getAllAndRemove(K name) Returns all values for the header with the specified name and removes them from this object.getAndRemove(K name) Returns the value of a header with the specified name and removes it from this object.getAndRemove(K name, V defaultValue) Returns the value of a header with the specified name and removes it from this object.getBoolean(K name) Returns thebooleanvalue of a header with the specified name.booleangetBoolean(K name, boolean defaultValue) Returns thebooleanvalue of a header with the specified name.getBooleanAndRemove(K name) Returns thebooleanvalue of a header with the specifiednameand removes the header from this object.booleangetBooleanAndRemove(K name, boolean defaultValue) Returns thebooleanvalue of a header with the specifiednameand removes the header from this object.Returns thebytevalue of a header with the specified name.byteReturns thebytevalue of a header with the specified name.getByteAndRemove(K name) Returns thebytevalue of a header with the specifiednameand removes the header from this object.bytegetByteAndRemove(K name, byte defaultValue) Returns thebytevalue of a header with the specifiednameand removes the header from this object.Returns thecharvalue of a header with the specified name.charReturns thecharvalue of a header with the specified name.getCharAndRemove(K name) Returns thecharvalue of a header with the specifiednameand removes the header from this object.chargetCharAndRemove(K name, char defaultValue) Returns thecharvalue of a header with the specifiednameand removes the header from this object.Returns thedoublevalue of a header with the specified name.doubleReturns thedoublevalue of a header with the specified name.getDoubleAndRemove(K name) Returns thedoublevalue of a header with the specifiednameand removes the header from this object.doublegetDoubleAndRemove(K name, double defaultValue) Returns thedoublevalue of a header with the specifiednameand removes the header from this object.Returns thefloatvalue of a header with the specified name.floatReturns thefloatvalue of a header with the specified name.getFloatAndRemove(K name) Returns thefloatvalue of a header with the specifiednameand removes the header from this object.floatgetFloatAndRemove(K name, float defaultValue) Returns thefloatvalue of a header with the specifiednameand removes the header from this object.Returns theintvalue of a header with the specified name.intReturns theintvalue of a header with the specified name.getIntAndRemove(K name) Returns theintvalue of a header with the specifiednameand removes the header from this object.intgetIntAndRemove(K name, int defaultValue) Returns theintvalue of a header with the specifiednameand removes the header from this object.Returns thelongvalue of a header with the specified name.longReturns thelongvalue of a header with the specified name.getLongAndRemove(K name) Returns thelongvalue of a header with the specifiednameand removes the header from this object.longgetLongAndRemove(K name, long defaultValue) Returns thelongvalue of a header with the specifiednameand removes the header from this object.Returns theshortvalue of a header with the specified name.shortReturns theshortvalue of a header with the specified name.getShortAndRemove(K name) Returns theshortvalue of a header with the specifiednameand removes the header from this object.shortgetShortAndRemove(K name, short defaultValue) Returns theshortvalue of a header with the specifiednameand removes the header from this object.getTimeMillis(K name) Returns the value of a header with the specified name in milliseconds.longgetTimeMillis(K name, long defaultValue) Returns the value of a header with the specified name in milliseconds.getTimeMillisAndRemove(K name) Returns the value of a header with the specifiednamein milliseconds and removes the header from this object.longgetTimeMillisAndRemove(K name, long defaultValue) Returns the value of a header with the specifiednamein milliseconds and removes the header from this object.inthashCode()final inthashCode(HashingStrategy<V> valueHashingStrategy) Generate a hash code for this object given aHashingStrategyto generate hash codes for individual values.booleanisEmpty()iterator()names()Returns aSetof all header names in this object.protected DefaultHeaders.NameValidator<K> protected DefaultHeaders.HeaderEntry<K, V> newHeaderEntry(int h, K name, V value, DefaultHeaders.HeaderEntry<K, V> next) booleanRemoves all headers with the specifiedname.Clears the current header entries and copies all header entries of the specifiedheaders.Sets a new header with the specified name and values.Sets a header with the specified name and value.Sets a header with the specified name and values.Retains all current headers but callsHeaders.set(K, V)for each entry inheaders.setBoolean(K name, boolean value) Set thenametovalue.Set thenametovalue.Set thenametovalue.Set thenametovalue.Set thenametovalue.Set thenametovalue.Set thenametovalue.Sets a header with the specified name and values.Sets a new header.Sets a header with the specified name and values.Set thenametovalue.setTimeMillis(K name, long value) Set thenametovalue.intsize()Returns the number of headers in this object.toString()protected voidvalidateName(DefaultHeaders.NameValidator<K> validator, boolean forAdd, K name) Call out to the givenDefaultHeaders.NameValidatorto validate the given name.protected voidvalidateValue(DefaultHeaders.ValueValidator<V> validator, K name, V value) protected ValueConverter<V> valueIterator(K name) Equivalent toDefaultHeaders.getAll(Object)but no intermediate list is generated.protected DefaultHeaders.ValueValidator<V> Methods inherited from interface Iterable
forEach, spliterator
-
Constructor Details
-
DefaultHeadersImpl
public DefaultHeadersImpl(HashingStrategy<K> nameHashingStrategy, ValueConverter<V> valueConverter, DefaultHeaders.NameValidator<K> nameValidator) -
DefaultHeadersImpl
public DefaultHeadersImpl(HashingStrategy<K> nameHashingStrategy, ValueConverter<V> valueConverter, DefaultHeaders.NameValidator<K> nameValidator, int arraySizeHint, DefaultHeaders.ValueValidator<V> valueValidator)
-