Package discord4j.rest.http
Class EmptyReaderStrategy
- java.lang.Object
-
- discord4j.rest.http.EmptyReaderStrategy
-
- All Implemented Interfaces:
ReaderStrategy<Void>
public class EmptyReaderStrategy extends Object implements ReaderStrategy<Void>
Read a response without a body.
-
-
Constructor Summary
Constructors Constructor Description EmptyReaderStrategy()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleancanRead(Class<?> type, String contentType)Whether the given object type is supported by this reader.Mono<Void>read(Mono<ByteBuf> content, Class<Void> responseType)Read from the input message and encode to a single object.
-
-
-
Method Detail
-
canRead
public boolean canRead(@Nullable Class<?> type, @Nullable String contentType)
Description copied from interface:ReaderStrategyWhether the given object type is supported by this reader.- Specified by:
canReadin interfaceReaderStrategy<Void>- Parameters:
type- the type of object to checkcontentType- the content type for the read- Returns:
trueif readable,falseotherwise
-
read
public Mono<Void> read(Mono<ByteBuf> content, Class<Void> responseType)
Description copied from interface:ReaderStrategyRead from the input message and encode to a single object.- Specified by:
readin interfaceReaderStrategy<Void>- Parameters:
content- the response contentsresponseType- the type of object in the response which must have been previously checked viaReaderStrategy.canRead(Class, String)- Returns:
- a Mono for the resolved response, according to the given response type
-
-