public final class DefaultHttpHeadersFactory extends java.lang.Object implements HttpHeadersFactory
HttpHeadersFactory
.Modifier and Type | Field and Description |
---|---|
static HttpHeadersFactory |
INSTANCE |
Constructor and Description |
---|
DefaultHttpHeadersFactory(boolean validateNames,
boolean validateCookies)
Create an instance of the factory with the default array size hint.
|
DefaultHttpHeadersFactory(boolean validateNames,
boolean validateCookies,
int headersArraySizeHint,
int trailersArraySizeHint)
Create an instance of the factory.
|
Modifier and Type | Method and Description |
---|---|
HttpHeaders |
newEmptyTrailers()
Create an
HttpHeaders instance designed to hold
trailers, possibly optimized for being empty. |
HttpHeaders |
newHeaders()
Create an
HttpHeaders instance. |
HttpHeaders |
newTrailers()
Create an
HttpHeaders instance designed to hold
trailers. |
boolean |
validateCookies()
Determine if a cookies should be validated during parsing into
HttpSetCookie s. |
public static final HttpHeadersFactory INSTANCE
public DefaultHttpHeadersFactory(boolean validateNames, boolean validateCookies)
validateNames
- true
to validate header/trailer names.validateCookies
- true
to validate cookie contents when parsing.public DefaultHttpHeadersFactory(boolean validateNames, boolean validateCookies, int headersArraySizeHint, int trailersArraySizeHint)
validateNames
- true
to validate header/trailer names.validateCookies
- true
to validate cookie contents when parsing.headersArraySizeHint
- A hint as to how large the hash data structure should be for the headers.trailersArraySizeHint
- A hint as to how large the hash data structure should be for the trailers.public HttpHeaders newHeaders()
HttpHeadersFactory
HttpHeaders
instance.newHeaders
in interface HttpHeadersFactory
HttpHeaders
instance.public HttpHeaders newTrailers()
HttpHeadersFactory
HttpHeaders
instance designed to hold
trailers.newTrailers
in interface HttpHeadersFactory
HttpHeaders
instance.public HttpHeaders newEmptyTrailers()
HttpHeadersFactory
HttpHeaders
instance designed to hold
trailers, possibly optimized for being empty.
Note: this should not return an immutable instance unless it is known that no code will need to mutate the trailers.
newEmptyTrailers
in interface HttpHeadersFactory
HttpHeaders
instance.public boolean validateCookies()
HttpHeadersFactory
HttpSetCookie
s.validateCookies
in interface HttpHeadersFactory
true
if a cookies should be validated during parsing into HttpSetCookie
s.