public class JacksonWriterStrategy extends Object implements WriterStrategy<Object>
Object to a JSON String using Jackson 2.9.| Constructor and Description |
|---|
JacksonWriterStrategy(ObjectMapper objectMapper) |
| Modifier and Type | Method and Description |
|---|---|
boolean |
canWrite(Class<?> type,
String contentType)
Whether the given object type is supported by this writer.
|
Mono<HttpClient.ResponseReceiver<?>> |
write(HttpClient.RequestSender sender,
Object body)
Write a given object to the output message.
|
public JacksonWriterStrategy(ObjectMapper objectMapper)
public boolean canWrite(@Nullable Class<?> type, @Nullable String contentType)
WriterStrategycanWrite in interface WriterStrategy<Object>type - the type of object to checkcontentType - the content type for the writetrue if writable, false otherwisepublic Mono<HttpClient.ResponseReceiver<?>> write(HttpClient.RequestSender sender, @Nullable Object body)
WriterStrategywrite in interface WriterStrategy<Object>sender - the http request senderbody - the object to write