public static < T > T convertTo ( String in , TypeReference < T > mapTo ) throws IOException { try { return mapper . readValue ( in , mapTo ) ; } catch ( Exception e ) { log . error ( "Can not convert:{} to {}" , in , mapTo , e ) ; throw new OvhServiceException ( "local" , "conversion Error to " + mapTo ) ; } }
Convert JSON String to a POJO java