Jackson ObjectMapper in Static Method with Generics
问题 I have a static method that is intended to read JSON and Parse to a Class (specified at runtime) with ObjectMapper. I would like to return an Object of the 'N' type, but I'm getting an error about using Generics. How can I make the following code accomplish this? public static <N, T extends AbstractRESTApplication> N GET_PAYLOAD( T app, String urlString, REQUEST_TYPE requestType) throws JsonProcessingException, MalformedURLException, IOException, NoSuchAlgorithmException,