public abstract static class HttpHeader.Builder<T extends HttpHeader.Builder> extends Object
Modifier and Type | Field and Description |
---|---|
protected HttpHeader |
packet |
Constructor and Description |
---|
HttpHeader.Builder() |
Modifier and Type | Method and Description |
---|---|
T |
chunked(boolean isChunked)
Set true, if this
HttpPacket content will be transferred
in chunking mode, or false if case of fixed-length message. |
T |
contentLength(long contentLength)
Set the content-length of this
HttpPacket . |
T |
contentType(String contentType)
Set the content-type of this
HttpPacket . |
T |
header(Header header,
String value)
Add the HTTP mime header.
|
T |
header(String name,
String value)
Add the HTTP mime header.
|
T |
maxNumHeaders(int num)
Sets the maximum number of headers allowed.
|
T |
protocol(Protocol protocol)
Set the HTTP message protocol version.
|
T |
protocol(String protocol)
Set the HTTP message protocol version.
|
T |
upgrade(String upgrade)
Set the HTTP upgrade type.
|
protected HttpHeader packet
public final T protocol(Protocol protocol)
protocol
- Protocol
public final T protocol(String protocol)
protocol
- protocol version in format "HTTP/1.x".public final T chunked(boolean isChunked)
HttpPacket
content will be transferred
in chunking mode, or false if case of fixed-length message.isChunked
- true, if this HttpPacket
content
will be transferred in chunking mode, or false if case
of fixed-length message.public final T contentLength(long contentLength)
HttpPacket
. Applicable only in case
of fixed-length HTTP message.contentLength
- the content-length of this HttpPacket
.
Applicable only in case of fixed-length HTTP message.public final T contentType(String contentType)
HttpPacket
.contentType
- the content-type of this HttpPacket
.public final T upgrade(String upgrade)
upgrade
- the type of upgrade.public final T header(String name, String value)
name
- the mime header name.value
- the mime header value.public final T header(Header header, String value)
header
- the mime Header
.value
- the mime header value.public final T maxNumHeaders(int num)
Copyright © 2013 Oracle Corporation. All Rights Reserved.