Returner
The "@Returner"
annotation is applied to those methods offered by libraries in which the response of an API request is processed and formatted according to a specific type of format
//This method is an example returner method
//ReturnFormat is for the example, but could be any type of formatter
private <T> T returnResponseFormatted(T responseDetails, ReturnFormat format) {
switch (format) {
case JSON:
return // response formatted as JSON
case LIBRARY_OBJECT:
return // response formatted as object given by the library
default: // this case is the STRING case
return // response formatted as simple string
}
}
Content copied to clipboard
Author
N7ghtm4r3 - Tecknobit
Types
Link copied to clipboard
enum ReturnFormat
List of formatters offered by library to format the responses as user wants