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 anHttpHeadersinstance designed to hold trailers, possibly optimized for being empty.Create anHttpHeadersinstance.Create anHttpHeadersinstance designed to hold trailers.toString()booleanDetermine if cookies should be validated during parsing intoHttpSetCookies.booleanDetermine if header names should be validated during parsing intoHttpHeaderss.booleanDetermine if header values should be validated during parsing intoHttpHeaderss.
-
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-trueto validate header/trailer names.validateCookies-trueto validate cookie contents when parsing.validateValues-trueto 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-trueto validate header/trailer names.validateCookies-trueto validate cookie contents when parsing.validateValues-trueto 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:HttpHeadersFactoryCreate anHttpHeadersinstance.- Specified by:
newHeadersin interfaceHttpHeadersFactory- Returns:
- an
HttpHeadersinstance.
-
newTrailers
Description copied from interface:HttpHeadersFactoryCreate anHttpHeadersinstance designed to hold trailers.- Specified by:
newTrailersin interfaceHttpHeadersFactory- Returns:
- an
HttpHeadersinstance.
-
newEmptyTrailers
Description copied from interface:HttpHeadersFactoryCreate anHttpHeadersinstance 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:
newEmptyTrailersin interfaceHttpHeadersFactory- Returns:
- an
HttpHeadersinstance.
-
validateNames
public boolean validateNames()Description copied from interface:HttpHeadersFactoryDetermine if header names should be validated during parsing intoHttpHeaderss.- Specified by:
validateNamesin interfaceHttpHeadersFactory- Returns:
trueif header names should be validated during parsing intoHttpHeaderss.
-
validateCookies
public boolean validateCookies()Description copied from interface:HttpHeadersFactoryDetermine if cookies should be validated during parsing intoHttpSetCookies.- Specified by:
validateCookiesin interfaceHttpHeadersFactory- Returns:
trueif a cookies should be validated during parsing intoHttpSetCookies.
-
validateValues
public boolean validateValues()Description copied from interface:HttpHeadersFactoryDetermine if header values should be validated during parsing intoHttpHeaderss.- Specified by:
validateValuesin interfaceHttpHeadersFactory- Returns:
trueif header values should be validated during parsing intoHttpHeaderss.
-
toString
-