Class EncodingServiceBuilder
java.lang.Object
com.linecorp.armeria.server.encoding.EncodingServiceBuilder
Builds a new
EncodingService
or its decorator function.-
Method Summary
Modifier and TypeMethodDescriptionbuild
(HttpService delegate) Returns a newly-createdEncodingService
based on the properties of this builder.encodableContentTypes
(MediaType... contentTypes) Sets the specifiedMediaType
s to evaluate whether the content type of theHttpResponse
is encodable or not.encodableContentTypes
(Iterable<MediaType> contentTypes) Sets the specifiedMediaType
s to evaluate whether the content type of theHttpResponse
is encodable or not.encodableContentTypes
(Predicate<MediaType> encodableContentTypePredicate) Sets the specifiedPredicate
to evaluate whether the content type of theHttpResponse
is encodable or not.encodableRequestHeaders
(Predicate<? super RequestHeaders> encodableRequestHeadersPredicate) Sets the specifiedPredicate
to evaluate whether the correspondingHttpResponse
of theHttpRequest
whoseRequestHeaders
is the input of thePredicate
is encodable or not.minBytesToForceChunkedEncoding
(int minBytesToForceChunkedAndEncoding) Sets the specified minimum length to force chunked encoding.Function
<? super HttpService, EncodingService> Returns a newly-created decorator that decorates anHttpService
with a newEncodingService
based on the properties of this builder.
-
Method Details
-
encodableContentTypes
Sets the specifiedMediaType
s to evaluate whether the content type of theHttpResponse
is encodable or not. It's encodable when the content type is one of theMediaType
s. -
encodableContentTypes
Sets the specifiedMediaType
s to evaluate whether the content type of theHttpResponse
is encodable or not. It's encodable when the content type is one of theMediaType
s. -
encodableContentTypes
public EncodingServiceBuilder encodableContentTypes(Predicate<MediaType> encodableContentTypePredicate) Sets the specifiedPredicate
to evaluate whether the content type of theHttpResponse
is encodable or not. -
encodableRequestHeaders
public EncodingServiceBuilder encodableRequestHeaders(Predicate<? super RequestHeaders> encodableRequestHeadersPredicate) Sets the specifiedPredicate
to evaluate whether the correspondingHttpResponse
of theHttpRequest
whoseRequestHeaders
is the input of thePredicate
is encodable or not. -
minBytesToForceChunkedEncoding
Sets the specified minimum length to force chunked encoding. TheHttpResponse
is encoded only when the content is variable, which means theResponseHeaders
does not have"Content-Length"
header, or the length of the content exceeds the specified length. The default is 1024. -
build
Returns a newly-createdEncodingService
based on the properties of this builder. -
newDecorator
Returns a newly-created decorator that decorates anHttpService
with a newEncodingService
based on the properties of this builder.
-