public abstract class SpdyHeaders extends Object implements Iterable<Map.Entry<String,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(String name,
Iterable<?> values)
Adds a new header with the specified name and values.
|
abstract SpdyHeaders |
add(String name,
Object value)
Adds a new header with the specified name and value.
|
static void |
addHeader(SpdyHeadersFrame frame,
String name,
Object value)
Adds a new header with the specified name and value.
|
abstract SpdyHeaders |
clear()
Removes all headers from this frame.
|
abstract boolean |
contains(String name)
Returns
true if and only if there is a header with the specified
header name. |
abstract List<Map.Entry<String,String>> |
entries()
Returns all header names and values that this frame contains.
|
abstract String |
get(String name)
Returns the header value with the specified header name.
|
abstract List<String> |
getAll(String name)
Returns the header values with the specified header name.
|
static String |
getHeader(SpdyHeadersFrame frame,
String name)
Returns the header value with the specified header name.
|
static String |
getHeader(SpdyHeadersFrame frame,
String name,
String defaultValue)
Returns the header value with the specified header name.
|
static 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 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 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.
|
Iterator<Map.Entry<String,String>> |
iterator() |
abstract Set<String> |
names()
Returns the
Set of all header names that this frame contains. |
abstract SpdyHeaders |
remove(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(String name,
Iterable<?> values)
Sets a new header with the specified name and values.
|
abstract SpdyHeaders |
set(String name,
Object value)
Sets a new header with the specified name and value.
|
static void |
setHeader(SpdyHeadersFrame frame,
String name,
Iterable<?> values)
Sets a new header with the specified name and values.
|
static void |
setHeader(SpdyHeadersFrame frame,
String name,
Object value)
Sets a new header with the specified name and value.
|
static void |
setHost(SpdyHeadersFrame frame,
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,
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,
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 String getHeader(SpdyHeadersFrame frame, String name)
null
if there is no such headerpublic static String getHeader(SpdyHeadersFrame frame, String name, String defaultValue)
defaultValue
if there is no such
headerpublic static void setHeader(SpdyHeadersFrame frame, String name, Object value)
public static void setHeader(SpdyHeadersFrame frame, String name, Iterable<?> values)
public static void addHeader(SpdyHeadersFrame frame, String name, Object value)
public static void removeHost(SpdyHeadersFrame frame)
public static String getHost(SpdyHeadersFrame frame)
public static void setHost(SpdyHeadersFrame frame, 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 String getScheme(int spdyVersion, SpdyHeadersFrame frame)
public static void setScheme(int spdyVersion, SpdyHeadersFrame frame, 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 String getUrl(int spdyVersion, SpdyHeadersFrame frame)
public static void setUrl(int spdyVersion, SpdyHeadersFrame frame, 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 abstract String get(String name)
null
if there is no such headerpublic abstract List<String> getAll(String name)
List
of header values. An empty list if there is no
such header.public abstract List<Map.Entry<String,String>> entries()
List
of the header name-value pairs. An empty list
if there is no header in this message.public abstract boolean contains(String name)
true
if and only if there is a header with the specified
header name.public abstract Set<String> names()
Set
of all header names that this frame contains.public abstract SpdyHeaders add(String name, Object value)
public abstract SpdyHeaders add(String name, Iterable<?> values)
public abstract SpdyHeaders set(String name, Object value)
public abstract SpdyHeaders set(String name, Iterable<?> values)
public abstract SpdyHeaders remove(String name)
public abstract SpdyHeaders clear()
public abstract boolean isEmpty()
Copyright © 2008-2016 The Netty Project. All Rights Reserved.