Interface AbstractBodyAdapter.BaseDecoder
- All Superinterfaces:
BodyAdapter, BodyAdapter.Decoder
- Enclosing class:
AbstractBodyAdapter
This interface abstracts the more-capable
toObject(TypeRef, Hints) method and adds a
default implementation for toObject(TypeRef, MediaType) that forwards to the former.
Additionally, this interface specifies a naive default implementation for toDeferredObject(TypeRef, Hints), which streaming decoders should override, and defaults
toDeferredObject(TypeRef, MediaType) to forward to the former.-
Nested Class Summary
Nested classes/interfaces inherited from interface BodyAdapter
BodyAdapter.Decoder, BodyAdapter.Encoder, BodyAdapter.Hints -
Method Summary
Modifier and TypeMethodDescriptiondefault <T> HttpResponse.BodySubscriber<Supplier<T>> toDeferredObject(TypeRef<T> typeRef, @Nullable MediaType mediaType) Returns a completedHttpResponse.BodySubscriberthat lazily decodes the response body into an object of the given type using the format specified by the given media type.default <T> HttpResponse.BodySubscriber<Supplier<T>> toDeferredObject(TypeRef<T> typeRef, BodyAdapter.Hints hints) Returns a completedHttpResponse.BodySubscriberthat lazily decodes the response body into an object of the given type using the givenBodyAdapter.Hints.default <T> HttpResponse.BodySubscriber<T> Returns aHttpResponse.BodySubscriberthat decodes the response body into an object of the given type using the format specified by the given media type.<T> HttpResponse.BodySubscriber<T> toObject(TypeRef<T> typeRef, BodyAdapter.Hints hints) Returns aHttpResponse.BodySubscriberthat decodes the response body into an object of the given type using the givenBodyAdapter.Hints.Methods inherited from interface BodyAdapter
isCompatibleWith, supportsType
-
Method Details
-
toObject
default <T> HttpResponse.BodySubscriber<T> toObject(TypeRef<T> typeRef, @Nullable MediaType mediaType) Returns aHttpResponse.BodySubscriberthat decodes the response body into an object of the given type using the format specified by the given media type. If the given media type isnull, the decoder's default format parameters (e.g., charset) are used.- Specified by:
toObjectin interfaceBodyAdapter.Decoder
-
toObject
Description copied from interface:BodyAdapter.DecoderReturns aHttpResponse.BodySubscriberthat decodes the response body into an object of the given type using the givenBodyAdapter.Hints.- Specified by:
toObjectin interfaceBodyAdapter.Decoder
-
toDeferredObject
default <T> HttpResponse.BodySubscriber<Supplier<T>> toDeferredObject(TypeRef<T> typeRef, @Nullable MediaType mediaType) Returns a completedHttpResponse.BodySubscriberthat lazily decodes the response body into an object of the given type using the format specified by the given media type. IfmediaTypeisnull, the decoder uses its default format parameters (e.g., charset).- Specified by:
toDeferredObjectin interfaceBodyAdapter.Decoder
-
toDeferredObject
default <T> HttpResponse.BodySubscriber<Supplier<T>> toDeferredObject(TypeRef<T> typeRef, BodyAdapter.Hints hints) Returns a completedHttpResponse.BodySubscriberthat lazily decodes the response body into an object of the given type using the givenBodyAdapter.Hints.- Specified by:
toDeferredObjectin interfaceBodyAdapter.Decoder
-