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); } }
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); } }