Module methanol
Interface AbstractBodyAdapter.BaseEncoder
-
- All Superinterfaces:
BodyAdapter,BodyAdapter.Encoder
- Enclosing class:
- AbstractBodyAdapter
public static interface AbstractBodyAdapter.BaseEncoder extends BodyAdapter.Encoder
This interface abstracts the more-capabletoBody(Object, TypeRef, Hints)method and adds a default implementation fortoBody(Object, MediaType)that forwards to the former.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface com.github.mizosoft.methanol.BodyAdapter
BodyAdapter.Decoder, BodyAdapter.Encoder, BodyAdapter.Hints
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description default java.net.http.HttpRequest.BodyPublishertoBody(java.lang.Object value, @Nullable MediaType mediaType)Returns aHttpRequest.BodyPublisherthat encodes the given object into a request body using the format specified by the given media type.<T> java.net.http.HttpRequest.BodyPublishertoBody(T value, TypeRef<T> typeRef, BodyAdapter.Hints hints)Returns aHttpRequest.BodyPublisherthat encodes the given object into a request body based on the givenTypeRef, using the given hintsBodyAdapter.Hintsfor encoder-specific customization.-
Methods inherited from interface com.github.mizosoft.methanol.BodyAdapter
isCompatibleWith, supportsType
-
-
-
-
Method Detail
-
toBody
default java.net.http.HttpRequest.BodyPublisher toBody(java.lang.Object value, @Nullable MediaType mediaType)Returns aHttpRequest.BodyPublisherthat encodes the given object into a request body using the format specified by the given media type. If the given media type isnull, the encoder uses its default format parameters (e.g., charset).- Specified by:
toBodyin interfaceBodyAdapter.Encoder
-
toBody
<T> java.net.http.HttpRequest.BodyPublisher toBody(T value, TypeRef<T> typeRef, BodyAdapter.Hints hints)Description copied from interface:BodyAdapter.EncoderReturns aHttpRequest.BodyPublisherthat encodes the given object into a request body based on the givenTypeRef, using the given hintsBodyAdapter.Hintsfor encoder-specific customization.- Specified by:
toBodyin interfaceBodyAdapter.Encoder
-
-