Interface AbstractBodyAdapter.BaseEncoder
- All Superinterfaces:
BodyAdapter, BodyAdapter.Encoder
- Enclosing class:
AbstractBodyAdapter
This interface abstracts the more-capable
toBody(Object, TypeRef, Hints) method and
adds a default implementation for toBody(Object, MediaType) that forwards to the
former.-
Nested Class Summary
Nested classes/interfaces inherited from interface BodyAdapter
BodyAdapter.Decoder, BodyAdapter.Encoder, BodyAdapter.Hints -
Method Summary
Modifier and TypeMethodDescriptiondefault HttpRequest.BodyPublisherReturns aHttpRequest.BodyPublisherthat encodes the given object into a request body using the format specified by the given media type.toBody(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 BodyAdapter
isCompatibleWith, supportsType
-
Method Details
-
toBody
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
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
-