Top Inners Fields Constructors Methods
io.netty.handler.codec.http

public Class EmptyHttpHeaders

extends HttpHeaders
Class Inheritance
Imports
java.util.Collections, .Iterator, .List, .Map.Entry, .Set

Nested and Inner Type Summary

Modifier and TypeClass and Description
private static class
EmptyHttpHeaders.InstanceInitializer

Deprecated
This class is needed to break a cyclic static initialization loop between HttpHeaders and EmptyHttpHeaders.

Field Summary

Modifier and TypeField and Description
pack-priv static final Iterator<Map.Entry<CharSequence, CharSequence>>
public static final EmptyHttpHeaders
Inherited from io.netty.handler.codec.http.HttpHeaders:
EMPTY_HEADERS

Constructor Summary

AccessConstructor and Description
protected

Method Summary

Modifier and TypeMethod and Description
public HttpHeaders
public HttpHeaders
add(String name, Iterable<?> values)

Implements abstract io.netty.handler.codec.http.HttpHeaders.add.

public HttpHeaders
addInt(CharSequence
The name to modify
name
,
int
The value
value
)

Implements abstract io.netty.handler.codec.http.HttpHeaders.addInt.

Add the name to value.
public HttpHeaders
addShort(CharSequence
The name to modify
name
,
short
The value
value
)

Implements abstract io.netty.handler.codec.http.HttpHeaders.addShort.

Add the name to value.
public HttpHeaders
clear()

Implements abstract io.netty.handler.codec.http.HttpHeaders.clear.

Removes all headers from this HttpMessage.
public boolean
public List<Map.Entry<String, String>>
entries()

Implements abstract io.netty.handler.codec.http.HttpHeaders.entries.

Returns a new List that contains all headers in this object.
public String
public List<String>
public Integer
getInt(CharSequence
the name of the header to search
name
)

Implements abstract io.netty.handler.codec.http.HttpHeaders.getInt.

Returns the integer value of a header with the specified name.
public int
getInt(CharSequence
the name of the header to search
name
,
int
the default value
defaultValue
)

Implements abstract io.netty.handler.codec.http.HttpHeaders.getInt.

Returns the integer value of a header with the specified name.
public Short
getShort(CharSequence
the name of the header to search
name
)

Implements abstract io.netty.handler.codec.http.HttpHeaders.getShort.

Returns the short value of a header with the specified name.
public short
getShort(CharSequence
the name of the header to search
name
,
short
the default value
defaultValue
)

Implements abstract io.netty.handler.codec.http.HttpHeaders.getShort.

Returns the short value of a header with the specified name.
public Long
getTimeMillis(CharSequence
the name of the header to search
name
)

Implements abstract io.netty.handler.codec.http.HttpHeaders.getTimeMillis.

Returns the date value of a header with the specified name.
public long
getTimeMillis(CharSequence
the name of the header to search
name
,
long
the default value
defaultValue
)

Implements abstract io.netty.handler.codec.http.HttpHeaders.getTimeMillis.

Returns the date value of a header with the specified name.
pack-priv static EmptyHttpHeaders
instance()

Deprecated Use EmptyHttpHeaders#INSTANCE

This is needed to break a cyclic static initialization loop between HttpHeaders and EmptyHttpHeaders.

public boolean
isEmpty()

Implements abstract io.netty.handler.codec.http.HttpHeaders.isEmpty.

Checks if no header exists.
public Iterator<Map.Entry<String, String>>
iterator()

Implements abstract io.netty.handler.codec.http.HttpHeaders.iterator.

Implements java.lang.Iterable.iterator.

Returns an iterator over elements of type T.
public Iterator<Map.Entry<CharSequence, CharSequence>>
public Set<String>
names()

Implements abstract io.netty.handler.codec.http.HttpHeaders.names.

Returns a new Set that contains the names of all headers in this object.
public HttpHeaders
public HttpHeaders
public HttpHeaders
set(String name, Iterable<?> values)

Implements abstract io.netty.handler.codec.http.HttpHeaders.set.

public HttpHeaders
setInt(CharSequence
The name to modify
name
,
int
The value
value
)

Implements abstract io.netty.handler.codec.http.HttpHeaders.setInt.

Set the name to value.
public HttpHeaders
setShort(CharSequence
The name to modify
name
,
short
The value
value
)

Implements abstract io.netty.handler.codec.http.HttpHeaders.setShort.

Set the name to value.
public int
size()

Implements abstract io.netty.handler.codec.http.HttpHeaders.size.

Returns the number of headers in this object.
Inherited from io.netty.handler.codec.http.HttpHeaders:
addaddaddaddDateHeaderaddDateHeaderaddHeaderaddHeaderaddIntHeaderaddIntHeaderclearHeaderscontainscontainscontainscontainsValuecopyencodeAsciiequalsIgnoreCasegetgetgetAllgetAllAsStringgetAsStringgetContentLengthgetContentLengthgetDategetDategetDateHeadergetDateHeadergetDateHeadergetDateHeadergetHeadergetHeadergetHeadergetHeadergetHostgetHostgetIntHeadergetIntHeadergetIntHeadergetIntHeaderis100ContinueExpectedisContentLengthSetisKeepAliveisTransferEncodingChunkediteratorAsStringnewEntityremoveremoveHeaderremoveHeaderremoveTransferEncodingChunkedsetsetsetset100ContinueExpectedset100ContinueExpectedsetAllsetContentLengthsetDatesetDateHeadersetDateHeadersetDateHeadersetDateHeadersetHeadersetHeadersetHeadersetHeadersetHostsetHostsetIntHeadersetIntHeadersetIntHeadersetIntHeadersetKeepAlivesetTransferEncodingChunkedtoStringvalueCharSequenceIteratorvalueStringIterator

Field Detail

EMPTY_CHARS_ITERATORback to summary
pack-priv static final Iterator<Map.Entry<CharSequence, CharSequence>> EMPTY_CHARS_ITERATOR
INSTANCEback to summary
public static final EmptyHttpHeaders INSTANCE

Constructor Detail

EmptyHttpHeadersback to summary
protected EmptyHttpHeaders()

Method Detail

addback to summary
public HttpHeaders add(String name, Object value)

Implements abstract io.netty.handler.codec.http.HttpHeaders.add.

Annotations
@Override
addback to summary
public HttpHeaders add(String name, Iterable<?> values)

Implements abstract io.netty.handler.codec.http.HttpHeaders.add.

Annotations
@Override
addIntback to summary
public HttpHeaders addInt(CharSequence name, int value)

Implements abstract io.netty.handler.codec.http.HttpHeaders.addInt.

Doc from io.netty.handler.codec.http.HttpHeaders.addInt.

Add the name to value.

Parameters
name:CharSequence

The name to modify

value:int

The value

Returns:HttpHeaders

this

Annotations
@Override
addShortback to summary
public HttpHeaders addShort(CharSequence name, short value)

Implements abstract io.netty.handler.codec.http.HttpHeaders.addShort.

Doc from io.netty.handler.codec.http.HttpHeaders.addShort.

Add the name to value.

Parameters
name:CharSequence

The name to modify

value:short

The value

Returns:HttpHeaders

this

Annotations
@Override
clearback to summary
public HttpHeaders clear()

Implements abstract io.netty.handler.codec.http.HttpHeaders.clear.

Doc from io.netty.handler.codec.http.HttpHeaders.clear.

Removes all headers from this HttpMessage.

Returns:HttpHeaders

this

Annotations
@Override
containsback to summary
public boolean contains(String name)

Implements abstract io.netty.handler.codec.http.HttpHeaders.contains.

Annotations
@Override
entriesback to summary
public List<Map.Entry<String, String>> entries()

Implements abstract io.netty.handler.codec.http.HttpHeaders.entries.

Doc from io.netty.handler.codec.http.HttpHeaders.entries.

Returns a new List that contains all headers in this object. Note that modifying the returned List will not affect the state of this object. If you intend to enumerate over the header entries only, use iterator() instead, which has much less overhead.

Annotations
@Override
getback to summary
public String get(String name)

Implements abstract io.netty.handler.codec.http.HttpHeaders.get.

Annotations
@Override
getAllback to summary
public List<String> getAll(String name)

Implements abstract io.netty.handler.codec.http.HttpHeaders.getAll.

Annotations
@Override
getIntback to summary
public Integer getInt(CharSequence name)

Implements abstract io.netty.handler.codec.http.HttpHeaders.getInt.

Doc from io.netty.handler.codec.http.HttpHeaders.getInt.

Returns the integer value of a header with the specified name. If there are more than one values for the specified name, the first value is returned.

Parameters
name:CharSequence

the name of the header to search

Returns:Integer

the first header value if the header is found and its value is an integer. null if there's no such header or its value is not an integer.

Annotations
@Override
getIntback to summary
public int getInt(CharSequence name, int defaultValue)

Implements abstract io.netty.handler.codec.http.HttpHeaders.getInt.

Doc from io.netty.handler.codec.http.HttpHeaders.getInt.

Returns the integer value of a header with the specified name. If there are more than one values for the specified name, the first value is returned.

Parameters
name:CharSequence

the name of the header to search

defaultValue:int

the default value

Returns:int

the first header value if the header is found and its value is an integer. defaultValue if there's no such header or its value is not an integer.

Annotations
@Override
getShortback to summary
public Short getShort(CharSequence name)

Implements abstract io.netty.handler.codec.http.HttpHeaders.getShort.

Doc from io.netty.handler.codec.http.HttpHeaders.getShort.

Returns the short value of a header with the specified name. If there are more than one values for the specified name, the first value is returned.

Parameters
name:CharSequence

the name of the header to search

Returns:Short

the first header value if the header is found and its value is a short. null if there's no such header or its value is not a short.

Annotations
@Override
getShortback to summary
public short getShort(CharSequence name, short defaultValue)

Implements abstract io.netty.handler.codec.http.HttpHeaders.getShort.

Doc from io.netty.handler.codec.http.HttpHeaders.getShort.

Returns the short value of a header with the specified name. If there are more than one values for the specified name, the first value is returned.

Parameters
name:CharSequence

the name of the header to search

defaultValue:short

the default value

Returns:short

the first header value if the header is found and its value is a short. defaultValue if there's no such header or its value is not a short.

Annotations
@Override
getTimeMillisback to summary
public Long getTimeMillis(CharSequence name)

Implements abstract io.netty.handler.codec.http.HttpHeaders.getTimeMillis.

Doc from io.netty.handler.codec.http.HttpHeaders.getTimeMillis.

Returns the date value of a header with the specified name. If there are more than one values for the specified name, the first value is returned.

Parameters
name:CharSequence

the name of the header to search

Returns:Long

the first header value if the header is found and its value is a date. null if there's no such header or its value is not a date.

Annotations
@Override
getTimeMillisback to summary
public long getTimeMillis(CharSequence name, long defaultValue)

Implements abstract io.netty.handler.codec.http.HttpHeaders.getTimeMillis.

Doc from io.netty.handler.codec.http.HttpHeaders.getTimeMillis.

Returns the date value of a header with the specified name. If there are more than one values for the specified name, the first value is returned.

Parameters
name:CharSequence

the name of the header to search

defaultValue:long

the default value

Returns:long

the first header value if the header is found and its value is a date. defaultValue if there's no such header or its value is not a date.

Annotations
@Override
instanceback to summary
pack-priv static EmptyHttpHeaders instance()

Deprecated

Use EmptyHttpHeaders#INSTANCE

This is needed to break a cyclic static initialization loop between HttpHeaders and EmptyHttpHeaders.

Annotations
@Deprecated
See Also
InstanceInitializer#EMPTY_HEADERS
isEmptyback to summary
public boolean isEmpty()

Implements abstract io.netty.handler.codec.http.HttpHeaders.isEmpty.

Doc from io.netty.handler.codec.http.HttpHeaders.isEmpty.

Checks if no header exists.

Annotations
@Override
iteratorback to summary
public Iterator<Map.Entry<String, String>> iterator()

Implements abstract io.netty.handler.codec.http.HttpHeaders.iterator.

Implements java.lang.Iterable.iterator.

Doc from java.lang.Iterable.iterator.

Returns an iterator over elements of type T.

Returns:Iterator<Map.Entry<String, String>>

an Iterator.

Annotations
@Override
iteratorCharSequenceback to summary
public Iterator<Map.Entry<CharSequence, CharSequence>> iteratorCharSequence()

Implements abstract io.netty.handler.codec.http.HttpHeaders.iteratorCharSequence.

Returns:Iterator<Map.Entry<CharSequence, CharSequence>>

Doc from io.netty.handler.codec.http.HttpHeaders.iteratorCharSequence.

Iterator over the name/value header pairs.

Annotations
@Override
namesback to summary
public Set<String> names()

Implements abstract io.netty.handler.codec.http.HttpHeaders.names.

Doc from io.netty.handler.codec.http.HttpHeaders.names.

Returns a new Set that contains the names of all headers in this object. Note that modifying the returned Set will not affect the state of this object. If you intend to enumerate over the header entries only, use iterator() instead, which has much less overhead.

Annotations
@Override
removeback to summary
public HttpHeaders remove(String name)

Implements abstract io.netty.handler.codec.http.HttpHeaders.remove.

Annotations
@Override
setback to summary
public HttpHeaders set(String name, Object value)

Implements abstract io.netty.handler.codec.http.HttpHeaders.set.

Annotations
@Override
setback to summary
public HttpHeaders set(String name, Iterable<?> values)

Implements abstract io.netty.handler.codec.http.HttpHeaders.set.

Annotations
@Override
setIntback to summary
public HttpHeaders setInt(CharSequence name, int value)

Implements abstract io.netty.handler.codec.http.HttpHeaders.setInt.

Doc from io.netty.handler.codec.http.HttpHeaders.setInt.

Set the name to value. This will remove all previous values associated with name.

Parameters
name:CharSequence

The name to modify

value:int

The value

Returns:HttpHeaders

this

Annotations
@Override
setShortback to summary
public HttpHeaders setShort(CharSequence name, short value)

Implements abstract io.netty.handler.codec.http.HttpHeaders.setShort.

Doc from io.netty.handler.codec.http.HttpHeaders.setShort.

Set the name to value. This will remove all previous values associated with name.

Parameters
name:CharSequence

The name to modify

value:short

The value

Returns:HttpHeaders

this

Annotations
@Override
sizeback to summary
public int size()

Implements abstract io.netty.handler.codec.http.HttpHeaders.size.

Doc from io.netty.handler.codec.http.HttpHeaders.size.

Returns the number of headers in this object.

Annotations
@Override
io.netty.handler.codec.http back to summary

private final Class EmptyHttpHeaders.InstanceInitializer

extends Object
Class Inheritance
  • java.lang.Object
  • io.netty.handler.codec.http.EmptyHttpHeaders.InstanceInitializer
Annotations
@Deprecated

Deprecated

This class is needed to break a cyclic static initialization loop between HttpHeaders and EmptyHttpHeaders.

Field Summary

Modifier and TypeField and Description
private static final EmptyHttpHeaders
EMPTY_HEADERS

The instance is instantiated here to break the cyclic static initialization between EmptyHttpHeaders and HttpHeaders.

Constructor Summary

AccessConstructor and Description
private

Method Summary

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

EMPTY_HEADERSback to summary
private static final EmptyHttpHeaders EMPTY_HEADERS

Deprecated

The instance is instantiated here to break the cyclic static initialization between EmptyHttpHeaders and HttpHeaders. The issue is that if someone accesses EmptyHttpHeaders#INSTANCE before HttpHeaders#EMPTY_HEADERS then HttpHeaders#EMPTY_HEADERS will be null.

Annotations
@Deprecated

Constructor Detail

InstanceInitializerback to summary
private InstanceInitializer()