Package discord4j.rest.http
Interface ReaderStrategy<T>
- Type Parameters:
T- the type of object in the read response
- All Known Implementing Classes:
EmptyReaderStrategy,FallbackReaderStrategy,JacksonReaderStrategy
public interface ReaderStrategy<T>
Strategy for reading from a
HttpClientResponse and decoding the stream of bytes
to an Object of type <Res>.-
Method Summary
-
Method Details
-
canRead
Whether the given object type is supported by this reader.- Parameters:
type- the type of object to checkcontentType- the content type for the read- Returns:
trueif readable,falseotherwise
-
read
Read from the input message and encode to a single object.- Parameters:
content- the response contentsresponseType- the type of object in the response which must have been previously checked viacanRead(Class, String)- Returns:
- a Mono for the resolved response, according to the given response type
-