- java.lang.Object
-
- com.github.mizosoft.methanol.adapter.ForwardingBodyAdapter
-
- com.github.mizosoft.methanol.adapter.ForwardingEncoder
-
- All Implemented Interfaces:
BodyAdapter,BodyAdapter.Encoder
public class ForwardingEncoder extends ForwardingBodyAdapter implements BodyAdapter.Encoder
AnBodyAdapter.Encoderthat forwards calls to another.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface com.github.mizosoft.methanol.BodyAdapter
BodyAdapter.Decoder, BodyAdapter.Encoder, BodyAdapter.Hints
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedForwardingEncoder(BodyAdapter.Encoder delegate)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected BodyAdapter.Encoderdelegate()Returns the adapter calls are being forwarded to.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 class com.github.mizosoft.methanol.adapter.ForwardingBodyAdapter
isCompatibleWith, supportsType, toString
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface com.github.mizosoft.methanol.BodyAdapter
isCompatibleWith, supportsType
-
-
-
-
Constructor Detail
-
ForwardingEncoder
protected ForwardingEncoder(BodyAdapter.Encoder delegate)
-
-
Method Detail
-
delegate
protected BodyAdapter.Encoder delegate()
Description copied from class:ForwardingBodyAdapterReturns the adapter calls are being forwarded to.- Specified by:
delegatein classForwardingBodyAdapter
-
toBody
public java.net.http.HttpRequest.BodyPublisher toBody(java.lang.Object value, @Nullable MediaType mediaType)Description copied from interface:BodyAdapter.EncoderReturns 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
public <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
-
-