public final class EncodingServiceBuilder extends Object
EncodingService or its decorator function.| Modifier and Type | Method and Description |
|---|---|
EncodingService |
build(HttpService delegate)
Returns a newly-created
EncodingService based on the properties of this builder. |
EncodingServiceBuilder |
encodableContentTypePredicate(Predicate<MediaType> encodableContentTypePredicate)
Sets the specified
Predicate to evaluate whether the content type of the HttpResponse is
encodable or not. |
EncodingServiceBuilder |
encodableContentTypes(Iterable<MediaType> contentTypes)
Sets the specified
MediaTypes to evaluate whether the content type of the HttpResponse
is encodable or not. |
EncodingServiceBuilder |
encodableContentTypes(MediaType... contentTypes)
Sets the specified
MediaTypes to evaluate whether the content type of the HttpResponse
is encodable or not. |
EncodingServiceBuilder |
encodableRequestHeadersPredicate(Predicate<? super RequestHeaders> encodableRequestHeadersPredicate)
Sets the specified
Predicate to evaluate whether the corresponding HttpResponse of the
HttpRequest whose RequestHeaders is the input of the Predicate
is encodable or not. |
EncodingServiceBuilder |
minBytesToForceChunkedEncoding(int minBytesToForceChunkedAndEncoding)
Sets the specified minimum length to force chunked encoding.
|
Function<? super HttpService,EncodingService> |
newDecorator()
Returns a newly-created decorator that decorates an
HttpService with a new
EncodingService based on the properties of this builder. |
public EncodingServiceBuilder encodableContentTypes(MediaType... contentTypes)
MediaTypes to evaluate whether the content type of the HttpResponse
is encodable or not. It's encodable when the content type is one of the MediaTypes.public EncodingServiceBuilder encodableContentTypes(Iterable<MediaType> contentTypes)
MediaTypes to evaluate whether the content type of the HttpResponse
is encodable or not. It's encodable when the content type is one of the MediaTypes.public EncodingServiceBuilder encodableContentTypePredicate(Predicate<MediaType> encodableContentTypePredicate)
Predicate to evaluate whether the content type of the HttpResponse is
encodable or not.public EncodingServiceBuilder encodableRequestHeadersPredicate(Predicate<? super RequestHeaders> encodableRequestHeadersPredicate)
Predicate to evaluate whether the corresponding HttpResponse of the
HttpRequest whose RequestHeaders is the input of the Predicate
is encodable or not.public EncodingServiceBuilder minBytesToForceChunkedEncoding(int minBytesToForceChunkedAndEncoding)
HttpResponse is encoded only
when the content is variable, which means the ResponseHeaders does not have
"Content-Length" header, or the length of the content exceeds the specified length.
The default is .public EncodingService build(HttpService delegate)
EncodingService based on the properties of this builder.public Function<? super HttpService,EncodingService> newDecorator()
HttpService with a new
EncodingService based on the properties of this builder.Copyright © 2020 LeanCloud. All rights reserved.