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 class
DefaultSpdyHeaders.HeaderEntry
private class
DefaultSpdyHeaders.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 int
BUCKET_SIZE
private DefaultSpdyHeaders.HeaderEntry[]
entries
private DefaultSpdyHeaders.HeaderEntry
head
-
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 SpdyHeaders
add(java.lang.String name, java.lang.Iterable<?> values)
Adds a new header with the specified name and values.SpdyHeaders
add(java.lang.String name, java.lang.Object value)
Adds a new header with the specified name and value.private void
add0(int h, int i, java.lang.String name, java.lang.String value)
SpdyHeaders
clear()
Removes all headers from this frame.boolean
contains(java.lang.String name)
Returnstrue
if 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 boolean
eq(java.lang.String name1, java.lang.String name2)
java.lang.String
get(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 int
hash(java.lang.String name)
private static int
index(int hash)
boolean
isEmpty()
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 theSet
of all header names that this frame contains.SpdyHeaders
remove(java.lang.String name)
Removes the header with the specified name.private void
remove0(int h, int i, java.lang.String name)
SpdyHeaders
set(java.lang.String name, java.lang.Iterable<?> values)
Sets a new header with the specified name and values.SpdyHeaders
set(java.lang.String name, java.lang.Object value)
Sets a new header with the specified name and value.private static java.lang.String
toString(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:SpdyHeaders
Adds a new header with the specified name and value.- Specified by:
add
in 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:SpdyHeaders
Removes the header with the specified name.- Specified by:
remove
in 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:SpdyHeaders
Sets 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:
set
in classSpdyHeaders
-
set
public SpdyHeaders set(java.lang.String name, java.lang.Iterable<?> values)
Description copied from class:SpdyHeaders
Sets 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:
set
in classSpdyHeaders
-
clear
public SpdyHeaders clear()
Description copied from class:SpdyHeaders
Removes all headers from this frame.- Specified by:
clear
in classSpdyHeaders
-
get
public java.lang.String get(java.lang.String name)
Description copied from class:SpdyHeaders
Returns 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:
get
in classSpdyHeaders
- Returns:
- the header value or
null
if there is no such header
-
getAll
public java.util.List<java.lang.String> getAll(java.lang.String name)
Description copied from class:SpdyHeaders
Returns the header values with the specified header name.- Specified by:
getAll
in classSpdyHeaders
- Returns:
- the
List
of 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:SpdyHeaders
Returns all header names and values that this frame contains.- Specified by:
entries
in classSpdyHeaders
- Returns:
- the
List
of 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:
iterator
in interfacejava.lang.Iterable<java.util.Map.Entry<java.lang.String,java.lang.String>>
- Overrides:
iterator
in classSpdyHeaders
-
contains
public boolean contains(java.lang.String name)
Description copied from class:SpdyHeaders
Returnstrue
if and only if there is a header with the specified header name.- Specified by:
contains
in classSpdyHeaders
-
names
public java.util.Set<java.lang.String> names()
Description copied from class:SpdyHeaders
Returns theSet
of all header names that this frame contains.- Specified by:
names
in classSpdyHeaders
-
add
public SpdyHeaders add(java.lang.String name, java.lang.Iterable<?> values)
Description copied from class:SpdyHeaders
Adds 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:
add
in classSpdyHeaders
-
isEmpty
public boolean isEmpty()
Description copied from class:SpdyHeaders
Checks if no header exists.- Specified by:
isEmpty
in classSpdyHeaders
-
toString
private static java.lang.String toString(java.lang.Object value)
-
-