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

public final Class ReadOnlyHttpHeaders

extends HttpHeaders
Class Inheritance
Annotations
@UnstableApi
Imports
io.netty.util.AsciiString, io.netty.util.internal.UnstableApi, java.util.AbstractMap.SimpleImmutableEntry, .ArrayList, .Collections, .Iterator, .LinkedHashSet, .List, .Map, .NoSuchElementException, .Set

A variant of HttpHeaders which only supports read-only methods.

Any array passed to this class may be used directly in the underlying data structures of this class. If these arrays may be modified it is the caller's responsibility to supply this class with a copy of the array.

This may be a good alternative to DefaultHttpHeaders if your have a fixed set of headers which will not change.

Nested and Inner Type Summary

Modifier and TypeClass and Description
private class
private class
private class
private class

Field Summary

Modifier and TypeField and Description
private final CharSequence[]
Inherited from io.netty.handler.codec.http.HttpHeaders:
EMPTY_HEADERS

Constructor Summary

AccessConstructor and Description
public
ReadOnlyHttpHeaders(boolean
true to validate the contents of each header name.
validateHeaders
,
CharSequence...
An array of the structure [<name,value>,<name,value>,...]. 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.
nameValuePairs
)

Create a new instance.

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 boolean
contains(String name, String value, boolean ignoreCase)

Overrides io.netty.handler.codec.http.HttpHeaders.contains.

public boolean
containsValue(CharSequence
the name of the header to find
name
,
CharSequence
the value of the header to find
value
,
boolean
true then a case insensitive compare is run to compare values. otherwise a case sensitive compare is run to compare values.
ignoreCase
)

Overrides io.netty.handler.codec.http.HttpHeaders.containsValue.

Returns true if a header with the name and value exists, false otherwise.
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
private CharSequence
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.
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.
private static IllegalArgumentException
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.
private static void
validateHeaders(CharSequence... keyValuePairs)

public Iterator<CharSequence>
valueCharSequenceIterator(CharSequence
the name of the header to retrieve
name
)

Overrides io.netty.handler.codec.http.HttpHeaders.valueCharSequenceIterator.

Equivalent to getAll(String) but it is possible that no intermediate list is generated.
public Iterator<String>
valueStringIterator(CharSequence
the name of the header to retrieve
name
)

Overrides io.netty.handler.codec.http.HttpHeaders.valueStringIterator.

Equivalent to getAll(String) but it is possible that no intermediate list is generated.
Inherited from io.netty.handler.codec.http.HttpHeaders:
addaddaddaddDateHeaderaddDateHeaderaddHeaderaddHeaderaddIntHeaderaddIntHeaderclearHeaderscontainscontainscopyencodeAsciiequalsIgnoreCasegetgetgetAllgetAllAsStringgetAsStringgetContentLengthgetContentLengthgetDategetDategetDateHeadergetDateHeadergetDateHeadergetDateHeadergetHeadergetHeadergetHeadergetHeadergetHostgetHostgetIntHeadergetIntHeadergetIntHeadergetIntHeaderis100ContinueExpectedisContentLengthSetisKeepAliveisTransferEncodingChunkediteratorAsStringnewEntityremoveremoveHeaderremoveHeaderremoveTransferEncodingChunkedsetsetsetset100ContinueExpectedset100ContinueExpectedsetAllsetContentLengthsetDatesetDateHeadersetDateHeadersetDateHeadersetDateHeadersetHeadersetHeadersetHeadersetHeadersetHostsetHostsetIntHeadersetIntHeadersetIntHeadersetIntHeadersetKeepAlivesetTransferEncodingChunkedtoString