public class DefaultHttpHeaders extends DefaultTextHeaders implements HttpHeaders
DefaultTextHeaders.DefaultTextValueTypeConverter
DefaultHeaders.HashCodeGenerator<T>, DefaultHeaders.IdentityNameConverter<T>, DefaultHeaders.KeyValueHeaderIterator, DefaultHeaders.NameConverter<T>
TextHeaders.EntryVisitor, TextHeaders.NameVisitor
ConvertibleHeaders.TypeConverter<UnconvertedType,ConvertedType>
Headers.ValueConverter<T>
Modifier | Constructor and Description |
---|---|
|
DefaultHttpHeaders() |
|
DefaultHttpHeaders(boolean validate) |
protected |
DefaultHttpHeaders(boolean validate,
boolean singleHeaderFields) |
protected |
DefaultHttpHeaders(boolean validate,
DefaultHeaders.NameConverter<CharSequence> nameConverter,
boolean singleHeaderFields) |
Modifier and Type | Method and Description |
---|---|
HttpHeaders |
add(CharSequence name,
CharSequence... values)
Adds a new header with the specified name and values.
|
HttpHeaders |
add(CharSequence name,
CharSequence value)
Adds a new header with the specified name and value.
|
HttpHeaders |
add(CharSequence name,
Iterable<? extends CharSequence> values)
Adds a new header with the specified name and values.
|
HttpHeaders |
add(TextHeaders headers)
|
HttpHeaders |
addBoolean(CharSequence name,
boolean value)
Add the
name to value . |
HttpHeaders |
addByte(CharSequence name,
byte value)
Add the
name to value . |
HttpHeaders |
addChar(CharSequence name,
char value)
Add the
name to value . |
HttpHeaders |
addDouble(CharSequence name,
double value)
Add the
name to value . |
HttpHeaders |
addFloat(CharSequence name,
float value)
Add the
name to value . |
HttpHeaders |
addInt(CharSequence name,
int value)
Add the
name to value . |
HttpHeaders |
addLong(CharSequence name,
long value)
Add the
name to value . |
HttpHeaders |
addObject(CharSequence name,
Iterable<?> values)
Adds a new header with the specified name and values.
|
HttpHeaders |
addObject(CharSequence name,
Object... values)
Adds a new header with the specified name and values.
|
HttpHeaders |
addObject(CharSequence name,
Object value)
Adds a new header with the specified name and value.
|
HttpHeaders |
addShort(CharSequence name,
short value)
Add the
name to value . |
HttpHeaders |
addTimeMillis(CharSequence name,
long value)
Add the
name to value . |
HttpHeaders |
clear()
Removes all headers.
|
HttpHeaders |
set(CharSequence name,
CharSequence... values)
Sets a header with the specified name and values.
|
HttpHeaders |
set(CharSequence name,
CharSequence value)
Sets a header with the specified name and value.
|
HttpHeaders |
set(CharSequence name,
Iterable<? extends CharSequence> values)
Sets a header with the specified name and values.
|
HttpHeaders |
set(TextHeaders headers)
|
HttpHeaders |
setAll(TextHeaders headers)
|
HttpHeaders |
setBoolean(CharSequence name,
boolean value)
Set the
name to value . |
HttpHeaders |
setByte(CharSequence name,
byte value)
Set the
name to value . |
HttpHeaders |
setChar(CharSequence name,
char value)
Set the
name to value . |
HttpHeaders |
setDouble(CharSequence name,
double value)
Set the
name to value . |
HttpHeaders |
setFloat(CharSequence name,
float value)
Set the
name to value . |
HttpHeaders |
setInt(CharSequence name,
int value)
Set the
name to value . |
HttpHeaders |
setLong(CharSequence name,
long value)
Set the
name to value . |
HttpHeaders |
setObject(CharSequence name,
Iterable<?> values)
Sets a header with the specified name and values.
|
HttpHeaders |
setObject(CharSequence name,
Object... values)
Sets a header with the specified name and values.
|
HttpHeaders |
setObject(CharSequence name,
Object value)
Sets a header with the specified name and value.
|
HttpHeaders |
setShort(CharSequence name,
short value)
Set the
name to value . |
HttpHeaders |
setTimeMillis(CharSequence name,
long value)
Set the
name to value . |
contains, containsObject
entriesConverted, getAllAndConvert, getAllAndRemoveAndConvert, getAndConvert, getAndConvert, getAndRemoveAndConvert, getAndRemoveAndConvert, iteratorConverted, namesAndConvert
add, contains, contains, contains, contains, containsBoolean, containsByte, containsChar, containsDouble, containsFloat, containsInt, containsLong, containsObject, containsObject, containsObject, containsShort, containsTimeMillis, entries, equals, forEachEntry, forEachName, 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, getInt, getIntAndRemove, getIntAndRemove, getLong, getLong, getLongAndRemove, getLongAndRemove, getShort, getShortAndRemove, getShortAndRemove, getTimeMillis, getTimeMillis, getTimeMillisAndRemove, getTimeMillisAndRemove, hashCode, isEmpty, iterator, names, namesList, remove, set, setAll, size, toString, valueConverter
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
contains, containsObject
entriesConverted, getAllAndConvert, getAllAndRemoveAndConvert, getAndConvert, getAndConvert, getAndRemoveAndConvert, getAndRemoveAndConvert, iteratorConverted, namesAndConvert
add, contains, contains, contains, contains, containsBoolean, containsByte, containsChar, containsDouble, containsFloat, containsInt, containsLong, containsObject, containsObject, containsObject, containsShort, containsTimeMillis, entries, forEachEntry, forEachName, 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, getInt, getIntAndRemove, getIntAndRemove, getLong, getLong, getLongAndRemove, getLongAndRemove, getShort, getShortAndRemove, getShortAndRemove, getTimeMillis, getTimeMillis, getTimeMillisAndRemove, getTimeMillisAndRemove, isEmpty, iterator, names, namesList, remove, set, setAll, size
public DefaultHttpHeaders()
public DefaultHttpHeaders(boolean validate)
protected DefaultHttpHeaders(boolean validate, boolean singleHeaderFields)
protected DefaultHttpHeaders(boolean validate, DefaultHeaders.NameConverter<CharSequence> nameConverter, boolean singleHeaderFields)
public HttpHeaders add(CharSequence name, CharSequence value)
Headers
String
, it is
converted into a String
by Object.toString()
, except in the cases of Date
and
Calendar
, which are formatted to the date format defined in RFC2616.add
in interface Headers<CharSequence>
add
in interface HttpHeaders
add
in interface TextHeaders
add
in class DefaultTextHeaders
name
- the name of the header being addedvalue
- the value of the header being addedthis
public HttpHeaders add(CharSequence name, Iterable<? extends CharSequence> values)
Headers
for (Object v : values) { if (v == null) { break; } headers.add(name, v); }
add
in interface Headers<CharSequence>
add
in interface HttpHeaders
add
in interface TextHeaders
add
in class DefaultTextHeaders
name
- the name of the headepublic abstract rs being setvalues
- the values of the headers being setthis
public HttpHeaders add(CharSequence name, CharSequence... values)
Headers
for (Object v : values) { if (v == null) { break; } headers.add(name, v); }
add
in interface Headers<CharSequence>
add
in interface HttpHeaders
add
in interface TextHeaders
add
in class DefaultTextHeaders
name
- the name of the headepublic abstract rs being setvalues
- the values of the headers being setthis
public HttpHeaders addObject(CharSequence name, Object value)
Headers
String
, it is
converted into a String
by Object.toString()
, except in the cases of Date
and
Calendar
, which are formatted to the date format defined in RFC2616.addObject
in interface Headers<CharSequence>
addObject
in interface HttpHeaders
addObject
in interface TextHeaders
addObject
in class DefaultTextHeaders
name
- the name of the header being addedvalue
- the value of the header being addedthis
public HttpHeaders addObject(CharSequence name, Iterable<?> values)
Headers
for (Object v : values) { if (v == null) { break; } headers.add(name, v); }
addObject
in interface Headers<CharSequence>
addObject
in interface HttpHeaders
addObject
in interface TextHeaders
addObject
in class DefaultTextHeaders
name
- the name of the headepublic abstract rs being setvalues
- the values of the headers being setthis
public HttpHeaders addObject(CharSequence name, Object... values)
Headers
for (Object v : values) { if (v == null) { break; } headers.add(name, v); }
addObject
in interface Headers<CharSequence>
addObject
in interface HttpHeaders
addObject
in interface TextHeaders
addObject
in class DefaultTextHeaders
name
- the name of the headepublic abstract rs being setvalues
- the values of the headers being setthis
public HttpHeaders addBoolean(CharSequence name, boolean value)
Headers
name
to value
.addBoolean
in interface Headers<CharSequence>
addBoolean
in interface HttpHeaders
addBoolean
in interface TextHeaders
addBoolean
in class DefaultTextHeaders
name
- The name to modifyvalue
- The valuethis
public HttpHeaders addChar(CharSequence name, char value)
Headers
name
to value
.addChar
in interface Headers<CharSequence>
addChar
in interface HttpHeaders
addChar
in interface TextHeaders
addChar
in class DefaultTextHeaders
name
- The name to modifyvalue
- The valuethis
public HttpHeaders addByte(CharSequence name, byte value)
Headers
name
to value
.addByte
in interface Headers<CharSequence>
addByte
in interface HttpHeaders
addByte
in interface TextHeaders
addByte
in class DefaultTextHeaders
name
- The name to modifyvalue
- The valuethis
public HttpHeaders addShort(CharSequence name, short value)
Headers
name
to value
.addShort
in interface Headers<CharSequence>
addShort
in interface HttpHeaders
addShort
in interface TextHeaders
addShort
in class DefaultTextHeaders
name
- The name to modifyvalue
- The valuethis
public HttpHeaders addInt(CharSequence name, int value)
Headers
name
to value
.addInt
in interface Headers<CharSequence>
addInt
in interface HttpHeaders
addInt
in interface TextHeaders
addInt
in class DefaultTextHeaders
name
- The name to modifyvalue
- The valuethis
public HttpHeaders addLong(CharSequence name, long value)
Headers
name
to value
.addLong
in interface Headers<CharSequence>
addLong
in interface HttpHeaders
addLong
in interface TextHeaders
addLong
in class DefaultTextHeaders
name
- The name to modifyvalue
- The valuethis
public HttpHeaders addFloat(CharSequence name, float value)
Headers
name
to value
.addFloat
in interface Headers<CharSequence>
addFloat
in interface HttpHeaders
addFloat
in interface TextHeaders
addFloat
in class DefaultTextHeaders
name
- The name to modifyvalue
- The valuethis
public HttpHeaders addDouble(CharSequence name, double value)
Headers
name
to value
.addDouble
in interface Headers<CharSequence>
addDouble
in interface HttpHeaders
addDouble
in interface TextHeaders
addDouble
in class DefaultTextHeaders
name
- The name to modifyvalue
- The valuethis
public HttpHeaders addTimeMillis(CharSequence name, long value)
Headers
name
to value
.addTimeMillis
in interface Headers<CharSequence>
addTimeMillis
in interface HttpHeaders
addTimeMillis
in interface TextHeaders
addTimeMillis
in class DefaultTextHeaders
name
- The name to modifyvalue
- The valuethis
public HttpHeaders add(TextHeaders headers)
TextHeaders
add
in interface HttpHeaders
add
in interface TextHeaders
add
in class DefaultTextHeaders
public HttpHeaders set(CharSequence name, CharSequence value)
Headers
String
, it is converted into a String
by
Object.toString()
, except for Date
and Calendar
, which are formatted
to the date format defined in RFC2616.set
in interface Headers<CharSequence>
set
in interface HttpHeaders
set
in interface TextHeaders
set
in class DefaultTextHeaders
name
- The name of the header being setvalue
- The value of the header being setthis
public HttpHeaders set(CharSequence name, Iterable<? extends CharSequence> values)
Headers
headers.remove(name); for (Object v : values) { if (v == null) { break; } headers.add(name, v); }
set
in interface Headers<CharSequence>
set
in interface HttpHeaders
set
in interface TextHeaders
set
in class DefaultTextHeaders
name
- the name of the headers being setvalues
- the values of the headers being setthis
public HttpHeaders set(CharSequence name, CharSequence... values)
Headers
headers.remove(name); for (Object v : values) { if (v == null) { break; } headers.add(name, v); }
set
in interface Headers<CharSequence>
set
in interface HttpHeaders
set
in interface TextHeaders
set
in class DefaultTextHeaders
name
- the name of the headers being setvalues
- the values of the headers being setthis
public HttpHeaders setObject(CharSequence name, Object value)
Headers
String
, it is converted into a String
by
Object.toString()
, except for Date
and Calendar
, which are formatted
to the date format defined in RFC2616.setObject
in interface Headers<CharSequence>
setObject
in interface HttpHeaders
setObject
in interface TextHeaders
setObject
in class DefaultTextHeaders
name
- The name of the header being setvalue
- The value of the header being setthis
public HttpHeaders setObject(CharSequence name, Iterable<?> values)
Headers
headers.remove(name); for (Object v : values) { if (v == null) { break; } headers.add(name, v); }
setObject
in interface Headers<CharSequence>
setObject
in interface HttpHeaders
setObject
in interface TextHeaders
setObject
in class DefaultTextHeaders
name
- the name of the headers being setvalues
- the values of the headers being setthis
public HttpHeaders setObject(CharSequence name, Object... values)
Headers
headers.remove(name); for (Object v : values) { if (v == null) { break; } headers.add(name, v); }
setObject
in interface Headers<CharSequence>
setObject
in interface HttpHeaders
setObject
in interface TextHeaders
setObject
in class DefaultTextHeaders
name
- the name of the headers being setvalues
- the values of the headers being setthis
public HttpHeaders setBoolean(CharSequence name, boolean value)
Headers
name
to value
. This will remove all previous values associated with name
.setBoolean
in interface Headers<CharSequence>
setBoolean
in interface HttpHeaders
setBoolean
in interface TextHeaders
setBoolean
in class DefaultTextHeaders
name
- The name to modifyvalue
- The valuethis
public HttpHeaders setChar(CharSequence name, char value)
Headers
name
to value
. This will remove all previous values associated with name
.setChar
in interface Headers<CharSequence>
setChar
in interface HttpHeaders
setChar
in interface TextHeaders
setChar
in class DefaultTextHeaders
name
- The name to modifyvalue
- The valuethis
public HttpHeaders setByte(CharSequence name, byte value)
Headers
name
to value
. This will remove all previous values associated with name
.setByte
in interface Headers<CharSequence>
setByte
in interface HttpHeaders
setByte
in interface TextHeaders
setByte
in class DefaultTextHeaders
name
- The name to modifyvalue
- The valuethis
public HttpHeaders setShort(CharSequence name, short value)
Headers
name
to value
. This will remove all previous values associated with name
.setShort
in interface Headers<CharSequence>
setShort
in interface HttpHeaders
setShort
in interface TextHeaders
setShort
in class DefaultTextHeaders
name
- The name to modifyvalue
- The valuethis
public HttpHeaders setInt(CharSequence name, int value)
Headers
name
to value
. This will remove all previous values associated with name
.setInt
in interface Headers<CharSequence>
setInt
in interface HttpHeaders
setInt
in interface TextHeaders
setInt
in class DefaultTextHeaders
name
- The name to modifyvalue
- The valuethis
public HttpHeaders setLong(CharSequence name, long value)
Headers
name
to value
. This will remove all previous values associated with name
.setLong
in interface Headers<CharSequence>
setLong
in interface HttpHeaders
setLong
in interface TextHeaders
setLong
in class DefaultTextHeaders
name
- The name to modifyvalue
- The valuethis
public HttpHeaders setFloat(CharSequence name, float value)
Headers
name
to value
. This will remove all previous values associated with name
.setFloat
in interface Headers<CharSequence>
setFloat
in interface HttpHeaders
setFloat
in interface TextHeaders
setFloat
in class DefaultTextHeaders
name
- The name to modifyvalue
- The valuethis
public HttpHeaders setDouble(CharSequence name, double value)
Headers
name
to value
. This will remove all previous values associated with name
.setDouble
in interface Headers<CharSequence>
setDouble
in interface HttpHeaders
setDouble
in interface TextHeaders
setDouble
in class DefaultTextHeaders
name
- The name to modifyvalue
- The valuethis
public HttpHeaders setTimeMillis(CharSequence name, long value)
Headers
name
to value
. This will remove all previous values associated with name
.setTimeMillis
in interface Headers<CharSequence>
setTimeMillis
in interface HttpHeaders
setTimeMillis
in interface TextHeaders
setTimeMillis
in class DefaultTextHeaders
name
- The name to modifyvalue
- The valuethis
public HttpHeaders set(TextHeaders headers)
TextHeaders
set
in interface HttpHeaders
set
in interface TextHeaders
set
in class DefaultTextHeaders
public HttpHeaders setAll(TextHeaders headers)
TextHeaders
setAll
in interface HttpHeaders
setAll
in interface TextHeaders
setAll
in class DefaultTextHeaders
public HttpHeaders clear()
Headers
clear
in interface Headers<CharSequence>
clear
in interface HttpHeaders
clear
in interface TextHeaders
clear
in class DefaultTextHeaders
this
Copyright © 2008–2015 The Netty Project. All rights reserved.