- com.fasterxml.jackson.databind.ObjectMapper objectMapper = new com.fasterxml.jackson.databind.ObjectMapper();
-
- return new ObjectMapper() {
- @Override
- public <T> T readValue(String value, Class<T> aClass) {
- try {
- return isEmpty(value) ? null : objectMapper.readValue(value, aClass);
- } catch (IOException e) {
- throw new SyncRestClientException("IOException while reading value", e);
- }
- }
-
- @Override
- public String writeValue(Object value) {
- try {
- return objectMapper.writeValueAsString(value);
- } catch (IOException e) {
- throw new SyncRestClientException("IOException while writing value", e);
- }
- }
- };