Package discord4j.rest.http
Class MultipartWriterStrategy
- java.lang.Object
-
- discord4j.rest.http.MultipartWriterStrategy
-
- All Implemented Interfaces:
WriterStrategy<MultipartRequest<?>>
public class MultipartWriterStrategy extends Object implements WriterStrategy<MultipartRequest<?>>
Write to a request from aConsumer<HttpClientRequest.Form>using reactor-netty'sHttpClient.RequestSender.sendForm(java.util.function.BiConsumer).- See Also:
HttpClientForm
-
-
Constructor Summary
Constructors Constructor Description MultipartWriterStrategy(ObjectMapper objectMapper)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleancanWrite(Class<?> type, String contentType)Whether the given object type is supported by this writer.Mono<HttpClient.ResponseReceiver<?>>write(HttpClient.RequestSender send, MultipartRequest<?> body)Write a given object to the output message.
-
-
-
Constructor Detail
-
MultipartWriterStrategy
public MultipartWriterStrategy(ObjectMapper objectMapper)
-
-
Method Detail
-
canWrite
public boolean canWrite(@Nullable Class<?> type, @Nullable String contentType)
Description copied from interface:WriterStrategyWhether the given object type is supported by this writer.- Specified by:
canWritein interfaceWriterStrategy<MultipartRequest<?>>- Parameters:
type- the type of object to checkcontentType- the content type for the write- Returns:
trueif writable,falseotherwise
-
write
public Mono<HttpClient.ResponseReceiver<?>> write(HttpClient.RequestSender send, @Nullable MultipartRequest<?> body)
Description copied from interface:WriterStrategyWrite a given object to the output message.- Specified by:
writein interfaceWriterStrategy<MultipartRequest<?>>- Parameters:
send- the http request senderbody- the object to write- Returns:
- indicates completion or error
-
-