public abstract class SpdyHeaders
extends java.lang.Object
implements java.lang.Iterable<java.util.Map.Entry<java.lang.String,java.lang.String>>
SpdyHeadersFrame
.Modifier and Type | Class and Description |
---|---|
static class |
SpdyHeaders.HttpNames
SPDY HTTP header names
|
Modifier and Type | Field and Description |
---|---|
static SpdyHeaders |
EMPTY_HEADERS |
Constructor and Description |
---|
SpdyHeaders() |
Modifier and Type | Method and Description |
---|---|
abstract SpdyHeaders |
add(java.lang.String name,
java.lang.Iterable<?> values)
Adds a new header with the specified name and values.
|
abstract SpdyHeaders |
add(java.lang.String name,
java.lang.Object value)
Adds a new header with the specified name and value.
|
static void |
addHeader(SpdyHeadersFrame frame,
java.lang.String name,
java.lang.Object value)
Adds a new header with the specified name and value.
|
abstract SpdyHeaders |
clear()
Removes all headers from this frame.
|
abstract boolean |
contains(java.lang.String name)
Returns
true if and only if there is a header with the specified
header name. |
abstract java.util.List<java.util.Map.Entry<java.lang.String,java.lang.String>> |
entries()
Returns all header names and values that this frame contains.
|
abstract java.lang.String |
get(java.lang.String name)
Returns the header value with the specified header name.
|
abstract java.util.List<java.lang.String> |
getAll(java.lang.String name)
Returns the header values with the specified header name.
|
static java.lang.String |
getHeader(SpdyHeadersFrame frame,
java.lang.String name)
Returns the header value with the specified header name.
|
static java.lang.String |
getHeader(SpdyHeadersFrame frame,
java.lang.String name,
java.lang.String defaultValue)
Returns the header value with the specified header name.
|
static java.lang.String |
getHost(SpdyHeadersFrame frame)
Returns the SPDY host header.
|
static HttpMethod |
getMethod(int spdyVersion,
SpdyHeadersFrame frame)
Returns the
HttpMethod represented by the HTTP method header. |
static java.lang.String |
getScheme(int spdyVersion,
SpdyHeadersFrame frame)
Returns the value of the URL scheme header.
|
static HttpResponseStatus |
getStatus(int spdyVersion,
SpdyHeadersFrame frame)
Returns the
HttpResponseStatus represented by the HTTP response status header. |
static java.lang.String |
getUrl(int spdyVersion,
SpdyHeadersFrame frame)
Returns the value of the URL path header.
|
static HttpVersion |
getVersion(int spdyVersion,
SpdyHeadersFrame frame)
Returns the
HttpVersion represented by the HTTP version header. |
abstract boolean |
isEmpty()
Checks if no header exists.
|
java.util.Iterator<java.util.Map.Entry<java.lang.String,java.lang.String>> |
iterator() |
abstract java.util.Set<java.lang.String> |
names()
Returns the
Set of all header names that this frame contains. |
abstract SpdyHeaders |
remove(java.lang.String name)
Removes the header with the specified name.
|
static void |
removeHost(SpdyHeadersFrame frame)
Removes the SPDY host header.
|
static void |
removeMethod(int spdyVersion,
SpdyHeadersFrame frame)
Removes the HTTP method header.
|
static void |
removeScheme(int spdyVersion,
SpdyHeadersFrame frame)
Removes the URL scheme header.
|
static void |
removeStatus(int spdyVersion,
SpdyHeadersFrame frame)
Removes the HTTP response status header.
|
static void |
removeUrl(int spdyVersion,
SpdyHeadersFrame frame)
Removes the URL path header.
|
static void |
removeVersion(int spdyVersion,
SpdyHeadersFrame frame)
Removes the HTTP version header.
|
abstract SpdyHeaders |
set(java.lang.String name,
java.lang.Iterable<?> values)
Sets a new header with the specified name and values.
|
abstract SpdyHeaders |
set(java.lang.String name,
java.lang.Object value)
Sets a new header with the specified name and value.
|
static void |
setHeader(SpdyHeadersFrame frame,
java.lang.String name,
java.lang.Iterable<?> values)
Sets a new header with the specified name and values.
|
static void |
setHeader(SpdyHeadersFrame frame,
java.lang.String name,
java.lang.Object value)
Sets a new header with the specified name and value.
|
static void |
setHost(SpdyHeadersFrame frame,
java.lang.String host)
Set the SPDY host header.
|
static void |
setMethod(int spdyVersion,
SpdyHeadersFrame frame,
HttpMethod method)
Sets the HTTP method header.
|
static void |
setScheme(int spdyVersion,
SpdyHeadersFrame frame,
java.lang.String scheme)
Sets the URL scheme header.
|
static void |
setStatus(int spdyVersion,
SpdyHeadersFrame frame,
HttpResponseStatus status)
Sets the HTTP response status header.
|
static void |
setUrl(int spdyVersion,
SpdyHeadersFrame frame,
java.lang.String path)
Sets the URL path header.
|
static void |
setVersion(int spdyVersion,
SpdyHeadersFrame frame,
HttpVersion httpVersion)
Sets the HTTP version header.
|
public static final SpdyHeaders EMPTY_HEADERS
public static java.lang.String getHeader(SpdyHeadersFrame frame, java.lang.String name)
null
if there is no such headerpublic static java.lang.String getHeader(SpdyHeadersFrame frame, java.lang.String name, java.lang.String defaultValue)
defaultValue
if there is no such
headerpublic static void setHeader(SpdyHeadersFrame frame, java.lang.String name, java.lang.Object value)
public static void setHeader(SpdyHeadersFrame frame, java.lang.String name, java.lang.Iterable<?> values)
public static void addHeader(SpdyHeadersFrame frame, java.lang.String name, java.lang.Object value)
public static void removeHost(SpdyHeadersFrame frame)
public static java.lang.String getHost(SpdyHeadersFrame frame)
public static void setHost(SpdyHeadersFrame frame, java.lang.String host)
public static void removeMethod(int spdyVersion, SpdyHeadersFrame frame)
public static HttpMethod getMethod(int spdyVersion, SpdyHeadersFrame frame)
HttpMethod
represented by the HTTP method header.public static void setMethod(int spdyVersion, SpdyHeadersFrame frame, HttpMethod method)
public static void removeScheme(int spdyVersion, SpdyHeadersFrame frame)
public static java.lang.String getScheme(int spdyVersion, SpdyHeadersFrame frame)
public static void setScheme(int spdyVersion, SpdyHeadersFrame frame, java.lang.String scheme)
public static void removeStatus(int spdyVersion, SpdyHeadersFrame frame)
public static HttpResponseStatus getStatus(int spdyVersion, SpdyHeadersFrame frame)
HttpResponseStatus
represented by the HTTP response status header.public static void setStatus(int spdyVersion, SpdyHeadersFrame frame, HttpResponseStatus status)
public static void removeUrl(int spdyVersion, SpdyHeadersFrame frame)
public static java.lang.String getUrl(int spdyVersion, SpdyHeadersFrame frame)
public static void setUrl(int spdyVersion, SpdyHeadersFrame frame, java.lang.String path)
public static void removeVersion(int spdyVersion, SpdyHeadersFrame frame)
public static HttpVersion getVersion(int spdyVersion, SpdyHeadersFrame frame)
HttpVersion
represented by the HTTP version header.public static void setVersion(int spdyVersion, SpdyHeadersFrame frame, HttpVersion httpVersion)
public java.util.Iterator<java.util.Map.Entry<java.lang.String,java.lang.String>> iterator()
iterator
in interface java.lang.Iterable<java.util.Map.Entry<java.lang.String,java.lang.String>>
public abstract java.lang.String get(java.lang.String name)
null
if there is no such headerpublic abstract java.util.List<java.lang.String> getAll(java.lang.String name)
List
of header values. An empty list if there is no
such header.public abstract java.util.List<java.util.Map.Entry<java.lang.String,java.lang.String>> entries()
List
of the header name-value pairs. An empty list
if there is no header in this message.public abstract boolean contains(java.lang.String name)
true
if and only if there is a header with the specified
header name.public abstract java.util.Set<java.lang.String> names()
Set
of all header names that this frame contains.public abstract SpdyHeaders add(java.lang.String name, java.lang.Object value)
public abstract SpdyHeaders add(java.lang.String name, java.lang.Iterable<?> values)
public abstract SpdyHeaders set(java.lang.String name, java.lang.Object value)
public abstract SpdyHeaders set(java.lang.String name, java.lang.Iterable<?> values)
public abstract SpdyHeaders remove(java.lang.String name)
public abstract SpdyHeaders clear()
public abstract boolean isEmpty()
Copyright © 2008–2018 The Netty Project. All rights reserved.