Interface BodyAdapter
- All Known Subinterfaces:
AbstractBodyAdapter.BaseDecoder, AbstractBodyAdapter.BaseEncoder, BodyAdapter.Decoder, BodyAdapter.Encoder
- All Known Implementing Classes:
AbstractBodyAdapter, BasicAdapter, ForwardingBodyAdapter, ForwardingDecoder, ForwardingEncoder
public interface BodyAdapter
An object that converts objects to or from request or response bodies respectively, using a
defined format. The two specialized subtypes are
BodyAdapter.Encoder and BodyAdapter.Decoder.
A BodyAdapter communicates the format it uses and the set of types it supports through
isCompatibleWith(MediaType) and supportsType(TypeRef) respectively. For
example, a BodyAdapter that uses JSON is compatible with any application/json
media type, and supports any object type supported by the underlying serializer/deserializer.
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic interfaceABodyAdapterthat decodes response bodies into objects.static interfaceABodyAdapterthat encodes objects into request bodies.static interfaceA collection of hints that provide additional context to customize an adapter's encoding/decoding behavior. -
Method Summary
Modifier and TypeMethodDescriptionbooleanisCompatibleWith(MediaType mediaType) Returnstrueif the format this adapter uses iscompatiblewith the given media type.booleansupportsType(TypeRef<?> typeRef) Returnstrueif this adapter supports the given type.
-
Method Details
-
isCompatibleWith
Returnstrueif the format this adapter uses iscompatiblewith the given media type. -
supportsType
Returnstrueif this adapter supports the given type.
-