Package io.servicetalk.http.netty
Class H2HeadersFactory
- java.lang.Object
-
- io.servicetalk.http.netty.H2HeadersFactory
-
- All Implemented Interfaces:
HttpHeadersFactory
public final class H2HeadersFactory extends java.lang.Object implements HttpHeadersFactory
AHttpHeadersFactory
optimized for HTTP/2.
-
-
Field Summary
Fields Modifier and Type Field Description static HttpHeadersFactory
INSTANCE
-
Constructor Summary
Constructors Constructor Description H2HeadersFactory(boolean validateNames, boolean validateCookies)
Create an instance of the factory with the default array size hint.H2HeadersFactory(boolean validateNames, boolean validateCookies, int headersArraySizeHint, int trailersArraySizeHint)
Create an instance of the factory.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description HttpHeaders
newEmptyTrailers()
Create anHttpHeaders
instance designed to hold trailers, possibly optimized for being empty.HttpHeaders
newHeaders()
Create anHttpHeaders
instance.HttpHeaders
newTrailers()
Create anHttpHeaders
instance designed to hold trailers.boolean
validateCookies()
Determine if a cookies should be validated during parsing intoHttpSetCookie
s.
-
-
-
Field Detail
-
INSTANCE
public static final HttpHeadersFactory INSTANCE
-
-
Constructor Detail
-
H2HeadersFactory
public H2HeadersFactory(boolean validateNames, boolean validateCookies)
Create an instance of the factory with the default array size hint.- Parameters:
validateNames
-true
to validate header/trailer names.validateCookies
-true
to validate cookie contents when parsing.
-
H2HeadersFactory
public H2HeadersFactory(boolean validateNames, boolean validateCookies, int headersArraySizeHint, int trailersArraySizeHint)
Create an instance of the factory.- Parameters:
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.
-
-
Method Detail
-
newHeaders
public HttpHeaders newHeaders()
Description copied from interface:HttpHeadersFactory
Create anHttpHeaders
instance.- Specified by:
newHeaders
in interfaceHttpHeadersFactory
- Returns:
- an
HttpHeaders
instance.
-
newTrailers
public HttpHeaders newTrailers()
Description copied from interface:HttpHeadersFactory
Create anHttpHeaders
instance designed to hold trailers.- Specified by:
newTrailers
in interfaceHttpHeadersFactory
- Returns:
- an
HttpHeaders
instance.
-
newEmptyTrailers
public HttpHeaders newEmptyTrailers()
Description copied from interface:HttpHeadersFactory
Create anHttpHeaders
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.
- Specified by:
newEmptyTrailers
in interfaceHttpHeadersFactory
- Returns:
- an
HttpHeaders
instance.
-
validateCookies
public boolean validateCookies()
Description copied from interface:HttpHeadersFactory
Determine if a cookies should be validated during parsing intoHttpSetCookie
s.- Specified by:
validateCookies
in interfaceHttpHeadersFactory
- Returns:
true
if a cookies should be validated during parsing intoHttpSetCookie
s.
-
-