- All Known Subinterfaces:
BodyAdapter.Decoder
,BodyAdapter.Encoder
- All Known Implementing Classes:
AbstractBodyAdapter
,CharSequenceEncoder
,ForwardingBodyAdapter
,ForwardingDecoder
,ForwardingEncoder
,StringDecoder
public interface BodyAdapter
An object that converts high 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
Modifier and TypeInterfaceDescriptionstatic interface
ABodyAdapter
that decodes response bodies into objects.static interface
ABodyAdapter
that encodes objects into request bodies. -
Method Summary
Modifier and TypeMethodDescriptionboolean
isCompatibleWith
(MediaType mediaType) Returnstrue
if the format this adapter uses iscompatible
with the given media type.boolean
supportsType
(TypeRef<?> type) Returnstrue
if this adapter supports the given type.
-
Method Details
-
isCompatibleWith
Returnstrue
if the format this adapter uses iscompatible
with the given media type. -
supportsType
Returnstrue
if this adapter supports the given type.
-