org.jboss.netty.handler.codec.spdy

## Class DefaultSpdyHeaderBlock

- java.lang.Object
- - org.jboss.netty.handler.codec.spdy.DefaultSpdyHeaderBlock

All Implemented Interfaces:
  SpdyHeaderBlock

Direct Known Subclasses:
  DefaultSpdyHeadersFrame, DefaultSpdySynReplyFrame, DefaultSpdySynStreamFrame

    public class DefaultSpdyHeaderBlock
    extends Object
    implements SpdyHeaderBlock

The default `SpdyHeaderBlock` implementation.

### Constructor Summary

Constructors
`protected` `DefaultSpdyHeaderBlock()` Creates a new instance.

### Method Summary

Methods
`void` `addHeader(String name, Object value)` Adds a new header with the specified name and value.
`protected void` `appendHeaders(StringBuilder buf)`
`void` `clearHeaders()` Removes all headers from this block.
`boolean` `containsHeader(String name)` Returns `true` if and only if there is a header with the specified header name.
`String` `getHeader(String name)` Returns the header value with the specified header name.
`Set<String>` `getHeaderNames()` Returns the `Set` of all header names that this block contains.
`List<Map.Entry<String,String>>` `getHeaders()` Returns all header names and values that this block contains.
`List<String>` `getHeaders(String name)` Returns the header values with the specified header name.
`boolean` `isInvalid()` Returns `true` if this header block is invalid.
`void` `removeHeader(String name)` Removes the header with the specified name.
`void` `setHeader(String name, Iterable<?> values)` Sets a new header with the specified name and values.
`void` `setHeader(String name, Object value)` Sets a new header with the specified name and value.
`void` `setInvalid()` Marks this header block as invalid.

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

### Constructor Detail

#### DefaultSpdyHeaderBlock

    protected DefaultSpdyHeaderBlock()

Creates a new instance.

### Method Detail

#### isInvalid

    public boolean isInvalid()

Description copied from interface: `SpdyHeaderBlock`
Returns `true` if this header block is invalid. A RST_STREAM frame with code PROTOCOL_ERROR should be sent.

Specified by:
  `isInvalid` in interface `SpdyHeaderBlock`

#### setInvalid

    public void setInvalid()

Description copied from interface: `SpdyHeaderBlock`
Marks this header block as invalid.

Specified by:
  `setInvalid` in interface `SpdyHeaderBlock`

#### addHeader

    public void addHeader(String name,
                 Object value)

Description copied from interface: `SpdyHeaderBlock`
Adds a new header with the specified name and value.

Specified by:
  `addHeader` in interface `SpdyHeaderBlock`

#### setHeader

    public void setHeader(String name,
                 Object value)

Description copied from interface: `SpdyHeaderBlock`
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:
  `setHeader` in interface `SpdyHeaderBlock`

#### setHeader

    public void setHeader(String name,
                 Iterable<?> values)

Description copied from interface: `SpdyHeaderBlock`
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:
  `setHeader` in interface `SpdyHeaderBlock`

#### removeHeader

    public void removeHeader(String name)

Description copied from interface: `SpdyHeaderBlock`
Removes the header with the specified name.

Specified by:
  `removeHeader` in interface `SpdyHeaderBlock`

#### clearHeaders

    public void clearHeaders()

Description copied from interface: `SpdyHeaderBlock`
Removes all headers from this block.

Specified by:
  `clearHeaders` in interface `SpdyHeaderBlock`

#### getHeader

    public String getHeader(String name)

Description copied from interface: `SpdyHeaderBlock`
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:
  `getHeader` in interface `SpdyHeaderBlock`
Returns:
  the header value or `null` if there is no such header

#### getHeaders

    public List<String> getHeaders(String name)

Description copied from interface: `SpdyHeaderBlock`
Returns the header values with the specified header name.

Specified by:
  `getHeaders` in interface `SpdyHeaderBlock`
Returns:
  the `List` of header values. An empty list if there is no such header.

#### getHeaders

    public List<Map.Entry<String,String>> getHeaders()

Description copied from interface: `SpdyHeaderBlock`
Returns all header names and values that this block contains.

Specified by:
  `getHeaders` in interface `SpdyHeaderBlock`
Returns:
  the `List` of the header name-value pairs. An empty list if there is no header in this message.

#### containsHeader

    public boolean containsHeader(String name)

Description copied from interface: `SpdyHeaderBlock`
Returns `true` if and only if there is a header with the specified header name.

Specified by:
  `containsHeader` in interface `SpdyHeaderBlock`

#### getHeaderNames

    public Set<String> getHeaderNames()

Description copied from interface: `SpdyHeaderBlock`
Returns the `Set` of all header names that this block contains.

Specified by:
  `getHeaderNames` in interface `SpdyHeaderBlock`

#### appendHeaders

    protected void appendHeaders(StringBuilder buf)