Package discord4j.rest.http
Class JacksonWriterStrategy
java.lang.Object
discord4j.rest.http.JacksonWriterStrategy
- All Implemented Interfaces:
WriterStrategy<Object>
Write to a request from an
Object
to a JSON String
using Jackson.-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionboolean
Whether the given object type is supported by this writer.write
(HttpClient.RequestSender sender, Object body) Write a given object to the output message.
-
Constructor Details
-
JacksonWriterStrategy
-
-
Method Details
-
canWrite
Description copied from interface:WriterStrategy
Whether the given object type is supported by this writer.- Specified by:
canWrite
in interfaceWriterStrategy<Object>
- Parameters:
type
- the type of object to checkcontentType
- the content type for the write- Returns:
true
if writable,false
otherwise
-
write
public Mono<HttpClient.ResponseReceiver<?>> write(HttpClient.RequestSender sender, @Nullable Object body) Description copied from interface:WriterStrategy
Write a given object to the output message.- Specified by:
write
in interfaceWriterStrategy<Object>
- Parameters:
sender
- the http request senderbody
- the object to write- Returns:
- indicates completion or error
-