Class DefaultSpdyHeaders
- java.lang.Object
-
- org.jboss.netty.handler.codec.spdy.SpdyHeaders
-
- org.jboss.netty.handler.codec.spdy.DefaultSpdyHeaders
-
- All Implemented Interfaces:
java.lang.Iterable<java.util.Map.Entry<java.lang.String,java.lang.String>>
public class DefaultSpdyHeaders extends SpdyHeaders
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description private static classDefaultSpdyHeaders.HeaderEntryprivate classDefaultSpdyHeaders.HeaderIterator-
Nested classes/interfaces inherited from class org.jboss.netty.handler.codec.spdy.SpdyHeaders
SpdyHeaders.HttpNames
-
-
Field Summary
Fields Modifier and Type Field Description private static intBUCKET_SIZEprivate DefaultSpdyHeaders.HeaderEntry[]entriesprivate DefaultSpdyHeaders.HeaderEntryhead-
Fields inherited from class org.jboss.netty.handler.codec.spdy.SpdyHeaders
EMPTY_HEADERS
-
-
Constructor Summary
Constructors Constructor Description DefaultSpdyHeaders()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description SpdyHeadersadd(java.lang.String name, java.lang.Iterable<?> values)Adds a new header with the specified name and values.SpdyHeadersadd(java.lang.String name, java.lang.Object value)Adds a new header with the specified name and value.private voidadd0(int h, int i, java.lang.String name, java.lang.String value)SpdyHeadersclear()Removes all headers from this frame.booleancontains(java.lang.String name)Returnstrueif and only if there is a header with the specified header name.java.util.List<java.util.Map.Entry<java.lang.String,java.lang.String>>entries()Returns all header names and values that this frame contains.private static booleaneq(java.lang.String name1, java.lang.String name2)java.lang.Stringget(java.lang.String name)Returns the header value with the specified header name.java.util.List<java.lang.String>getAll(java.lang.String name)Returns the header values with the specified header name.private static inthash(java.lang.String name)private static intindex(int hash)booleanisEmpty()Checks if no header exists.java.util.Iterator<java.util.Map.Entry<java.lang.String,java.lang.String>>iterator()java.util.Set<java.lang.String>names()Returns theSetof all header names that this frame contains.SpdyHeadersremove(java.lang.String name)Removes the header with the specified name.private voidremove0(int h, int i, java.lang.String name)SpdyHeadersset(java.lang.String name, java.lang.Iterable<?> values)Sets a new header with the specified name and values.SpdyHeadersset(java.lang.String name, java.lang.Object value)Sets a new header with the specified name and value.private static java.lang.StringtoString(java.lang.Object value)-
Methods inherited from class org.jboss.netty.handler.codec.spdy.SpdyHeaders
addHeader, getHeader, getHeader, getHost, getMethod, getScheme, getStatus, getUrl, getVersion, removeHost, removeMethod, removeScheme, removeStatus, removeUrl, removeVersion, setHeader, setHeader, setHost, setMethod, setScheme, setStatus, setUrl, setVersion
-
-
-
-
Field Detail
-
BUCKET_SIZE
private static final int BUCKET_SIZE
- See Also:
- Constant Field Values
-
entries
private final DefaultSpdyHeaders.HeaderEntry[] entries
-
head
private final DefaultSpdyHeaders.HeaderEntry head
-
-
Method Detail
-
hash
private static int hash(java.lang.String name)
-
eq
private static boolean eq(java.lang.String name1, java.lang.String name2)
-
index
private static int index(int hash)
-
add
public SpdyHeaders add(java.lang.String name, java.lang.Object value)
Description copied from class:SpdyHeadersAdds a new header with the specified name and value.- Specified by:
addin classSpdyHeaders
-
add0
private void add0(int h, int i, java.lang.String name, java.lang.String value)
-
remove
public SpdyHeaders remove(java.lang.String name)
Description copied from class:SpdyHeadersRemoves the header with the specified name.- Specified by:
removein classSpdyHeaders
-
remove0
private void remove0(int h, int i, java.lang.String name)
-
set
public SpdyHeaders set(java.lang.String name, java.lang.Object value)
Description copied from class:SpdyHeadersSets a new header with the specified name and value. If there is an existing header with the same name, the existing header is removed.- Specified by:
setin classSpdyHeaders
-
set
public SpdyHeaders set(java.lang.String name, java.lang.Iterable<?> values)
Description copied from class:SpdyHeadersSets a new header with the specified name and values. If there is an existing header with the same name, the existing header is removed.- Specified by:
setin classSpdyHeaders
-
clear
public SpdyHeaders clear()
Description copied from class:SpdyHeadersRemoves all headers from this frame.- Specified by:
clearin classSpdyHeaders
-
get
public java.lang.String get(java.lang.String name)
Description copied from class:SpdyHeadersReturns the header value with the specified header name. If there is more than one header value for the specified header name, the first value is returned.- Specified by:
getin classSpdyHeaders- Returns:
- the header value or
nullif there is no such header
-
getAll
public java.util.List<java.lang.String> getAll(java.lang.String name)
Description copied from class:SpdyHeadersReturns the header values with the specified header name.- Specified by:
getAllin classSpdyHeaders- Returns:
- the
Listof header values. An empty list if there is no such header.
-
entries
public java.util.List<java.util.Map.Entry<java.lang.String,java.lang.String>> entries()
Description copied from class:SpdyHeadersReturns all header names and values that this frame contains.- Specified by:
entriesin classSpdyHeaders- Returns:
- the
Listof the header name-value pairs. An empty list if there is no header in this message.
-
iterator
public java.util.Iterator<java.util.Map.Entry<java.lang.String,java.lang.String>> iterator()
- Specified by:
iteratorin interfacejava.lang.Iterable<java.util.Map.Entry<java.lang.String,java.lang.String>>- Overrides:
iteratorin classSpdyHeaders
-
contains
public boolean contains(java.lang.String name)
Description copied from class:SpdyHeadersReturnstrueif and only if there is a header with the specified header name.- Specified by:
containsin classSpdyHeaders
-
names
public java.util.Set<java.lang.String> names()
Description copied from class:SpdyHeadersReturns theSetof all header names that this frame contains.- Specified by:
namesin classSpdyHeaders
-
add
public SpdyHeaders add(java.lang.String name, java.lang.Iterable<?> values)
Description copied from class:SpdyHeadersAdds a new header with the specified name and values. If there is an existing header with the same name, the existing header is removed.- Specified by:
addin classSpdyHeaders
-
isEmpty
public boolean isEmpty()
Description copied from class:SpdyHeadersChecks if no header exists.- Specified by:
isEmptyin classSpdyHeaders
-
toString
private static java.lang.String toString(java.lang.Object value)
-
-