Package io.servicetalk.http.api
Class DefaultHttpHeadersFactory
java.lang.Object
io.servicetalk.http.api.DefaultHttpHeadersFactory
- All Implemented Interfaces:
HttpHeadersFactory
Default implementation of
HttpHeadersFactory
.-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionDefaultHttpHeadersFactory
(boolean validateNames, boolean validateCookies, boolean validateValues) Create an instance of the factory with the default array size hint.DefaultHttpHeadersFactory
(boolean validateNames, boolean validateCookies, boolean validateValues, int headersArraySizeHint, int trailersArraySizeHint) Create an instance of the factory. -
Method Summary
Modifier and TypeMethodDescriptionCreate anHttpHeaders
instance designed to hold trailers, possibly optimized for being empty.Create anHttpHeaders
instance.Create anHttpHeaders
instance designed to hold trailers.toString()
boolean
Determine if cookies should be validated during parsing intoHttpSetCookie
s.boolean
Determine if header names should be validated during parsing intoHttpHeaders
s.boolean
Determine if header values should be validated during parsing intoHttpHeaders
s.
-
Field Details
-
INSTANCE
-
-
Constructor Details
-
DefaultHttpHeadersFactory
public DefaultHttpHeadersFactory(boolean validateNames, boolean validateCookies, boolean validateValues) 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.validateValues
-true
to validate header/trailer values.
-
DefaultHttpHeadersFactory
public DefaultHttpHeadersFactory(boolean validateNames, boolean validateCookies, boolean validateValues, 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.validateValues
-true
to validate header/trailer values.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 Details
-
newHeaders
Description copied from interface:HttpHeadersFactory
Create anHttpHeaders
instance.- Specified by:
newHeaders
in interfaceHttpHeadersFactory
- Returns:
- an
HttpHeaders
instance.
-
newTrailers
Description copied from interface:HttpHeadersFactory
Create anHttpHeaders
instance designed to hold trailers.- Specified by:
newTrailers
in interfaceHttpHeadersFactory
- Returns:
- an
HttpHeaders
instance.
-
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.
-
validateNames
public boolean validateNames()Description copied from interface:HttpHeadersFactory
Determine if header names should be validated during parsing intoHttpHeaders
s.- Specified by:
validateNames
in interfaceHttpHeadersFactory
- Returns:
true
if header names should be validated during parsing intoHttpHeaders
s.
-
validateCookies
public boolean validateCookies()Description copied from interface:HttpHeadersFactory
Determine if 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.
-
validateValues
public boolean validateValues()Description copied from interface:HttpHeadersFactory
Determine if header values should be validated during parsing intoHttpHeaders
s.- Specified by:
validateValues
in interfaceHttpHeadersFactory
- Returns:
true
if header values should be validated during parsing intoHttpHeaders
s.
-
toString
-