Exemplo n.º 1
0
 private <T> T deserializeJson(String json, Class<T> klass, ApiClient apiClient) {
   ObjectMapper mapper = apiClient.getJSON().getContext(null);
   try {
     return mapper.readValue(json, klass);
   } catch (Exception e) {
     throw new RuntimeException(e);
   }
 }
Exemplo n.º 2
0
 private String serializeJson(Object o, ApiClient apiClient) {
   ObjectMapper mapper = apiClient.getJSON().getContext(null);
   try {
     return mapper.writeValueAsString(o);
   } catch (Exception e) {
     throw new RuntimeException(e);
   }
 }