logger.debug("Post body:\n " + postBody); } catch (JsonProcessingException e) { logger.error(e.getLocalizedMessage(), e);
/** * Convert this object to a string representation. * * @return This application data represented as a JSON structure */ @Override public String toString() { try { return MAPPER.writeValueAsString(this); } catch (final JsonProcessingException ioe) { return ioe.getLocalizedMessage(); } }
/** * Convert this object to a string representation. * * @return This application data represented as a JSON structure */ @Override public String toString() { try { return MAPPER.writeValueAsString(this); } catch (final JsonProcessingException ioe) { return ioe.getLocalizedMessage(); } } }
private String cypherRequest(Statements statements) { try { return mapper.writeValueAsString(statements); } catch (JsonProcessingException jpe) { throw new ResultProcessingException("Could not create JSON due to " + jpe.getLocalizedMessage(), jpe); } }
private String cypherRequest(Statements statements) { try { return OBJECT_MAPPER.writeValueAsString(statements); } catch (JsonProcessingException jpe) { throw new ResultProcessingException("Could not create JSON due to " + jpe.getLocalizedMessage(), jpe); } }
private String cypherRequest(Statement statement) { List<Statement> statementList = new ArrayList<>(); statementList.add(statement); try { return mapper.writeValueAsString(new Statements(statementList)); } catch (JsonProcessingException jpe) { throw new ResultProcessingException("Could not create JSON due to " + jpe.getLocalizedMessage(), jpe); } }
private String cypherRequest(Statement statement) { List<Statement> statementList = new ArrayList<>(); statementList.add(statement); try { return OBJECT_MAPPER.writeValueAsString(new Statements(statementList)); } catch (JsonProcessingException jpe) { throw new ResultProcessingException("Could not create JSON due to " + jpe.getLocalizedMessage(), jpe); } }
@Override public Event save(Event event, String tenantId) { if (event == null) { throw new IllegalArgumentException("Event cannot be null"); } EventRedis eventRedis = new EventRedis(tenantId, event); try { redisTemplate.convertAndSend(channelName, objectMapper.writer().writeValueAsString(eventRedis)); } catch (JsonProcessingException e) { log.error(e.getLocalizedMessage()); throw new RuntimeException(); } return event; }
return ow.writeValueAsString(this); } catch (JsonProcessingException e) { logger.error(e.getLocalizedMessage()); throw e;
/** * Return the section of resource statuses for docker action status. */ private String getResponseLibInstall(boolean isSuccess) { List<LibInstallDTO> list; try { JsonNode json = MAPPER.readTree(parser.getJson()); json = json.get("libs"); list = MAPPER.readValue(json.toString(), new TypeReference<List<LibInstallDTO>>() { }); } catch (IOException e) { throw new DlabException("Can't parse json content: " + e.getLocalizedMessage(), e); } for (LibInstallDTO lib : list) { if (isSuccess) { lib.setStatus(LibStatus.INSTALLED.toString()); } else { lib.setStatus(LibStatus.FAILED.toString()); lib.setErrorMessage("Mock error message"); } } try { return MAPPER.writeValueAsString(list); } catch (JsonProcessingException e) { throw new DlabException("Can't generate json content: " + e.getLocalizedMessage(), e); } }
return MAPPER.writeValueAsString(resourceList); } catch (JsonProcessingException e) { throw new DlabException("Can't generate json content: " + e.getLocalizedMessage(), e);