java.lang.Object
com.github.mizosoft.methanol.adapter.AbstractBodyAdapter
com.github.mizosoft.methanol.testing.StringDecoder
- All Implemented Interfaces:
BodyAdapter
,BodyAdapter.Decoder
-
Nested Class Summary
Nested classes/interfaces inherited from class com.github.mizosoft.methanol.adapter.AbstractBodyAdapter
AbstractBodyAdapter.BaseDecoder, AbstractBodyAdapter.BaseEncoder
Nested classes/interfaces inherited from interface com.github.mizosoft.methanol.BodyAdapter
BodyAdapter.Decoder, BodyAdapter.Encoder, BodyAdapter.Hints
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionboolean
supportsType
(TypeRef<?> type) Returnstrue
if this adapter supports the given type.<T> HttpResponse.BodySubscriber
<T> Returns aHttpResponse.BodySubscriber
that decodes the response body into an object of the given type using the format specified by the given media type.Methods inherited from class com.github.mizosoft.methanol.adapter.AbstractBodyAdapter
attachMediaType, charsetOrDefault, charsetOrUtf8, compatibleMediaTypes, isCompatibleWith, requireCompatibleOrNull, requireSupport, requireSupport, requireSupport
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface com.github.mizosoft.methanol.BodyAdapter
isCompatibleWith
Methods inherited from interface com.github.mizosoft.methanol.BodyAdapter.Decoder
toDeferredObject, toDeferredObject, toObject
-
Constructor Details
-
StringDecoder
public StringDecoder()
-
-
Method Details
-
supportsType
Description copied from interface:BodyAdapter
Returnstrue
if this adapter supports the given type.- Specified by:
supportsType
in interfaceBodyAdapter
-
toObject
public <T> HttpResponse.BodySubscriber<T> toObject(TypeRef<T> objectType, @Nullable MediaType mediaType) Description copied from interface:BodyAdapter.Decoder
Returns aHttpResponse.BodySubscriber
that 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:
toObject
in interfaceBodyAdapter.Decoder
-