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 interface com.github.mizosoft.methanol.BodyAdapter
BodyAdapter.Decoder, BodyAdapter.Encoder
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionboolean
supportsType
(TypeRef<?> type) Returnstrue
if this adapter supports the given type.<T> HttpResponse.BodySubscriber
<T> Returns aBodySubscriber
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
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
-
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 aBodySubscriber
that decodes the response body into an object of the given type using the format specified by the given media type. IfmediaType
isnull
, the decoder's default format parameters (e.g. charset) are used.- Specified by:
toObject
in interfaceBodyAdapter.Decoder
-