@Test void fromStringArray() { assertEquals(Arrays.asList(1, 2, 3), this.tool.fromString("[1,2,3]")); }
public Object fromString(String str) { if (StringUtils.isNotBlank(str)) { ObjectMapper objectMapper = new ObjectMapper(); try { return objectMapper.readValue(str, Object.class); } catch (Exception e) { LOGGER.info("Failed to parse JSON [{}]: {}", StringUtils.abbreviate(str, 32), ExceptionUtils.getRootCauseMessage(e)); return null; } } return null; }
JSONTool { public Object fromString(String str) { if (StringUtils.isNotBlank(str)) { ObjectMapper objectMapper = new ObjectMapper(); try { return objectMapper.readValue(str, Object.class); } catch (Exception e) { LOGGER.info("Failed to parse JSON [{}]: {}", StringUtils.abbreviate(str, 32), ExceptionUtils.getRootCauseMessage(e)); return null; } } return null; } }
JSONTool { public Object fromString(String str) { if (StringUtils.isNotBlank(str)) { ObjectMapper objectMapper = new ObjectMapper(); try { return objectMapper.readValue(str, Object.class); } catch (Exception e) { LOGGER.info("Failed to parse JSON [{}]: {}", StringUtils.abbreviate(str, 32), ExceptionUtils.getRootCauseMessage(e)); return null; } } return null; }  }
JSONTool { public Object fromString(String str) { if (StringUtils.isNotBlank(str)) { ObjectMapper objectMapper = new ObjectMapper(); try { return objectMapper.readValue(str, Object.class); } catch (Exception e) { LOGGER.info("Failed to parse JSON [{}]: {}", StringUtils.abbreviate(str, 32), ExceptionUtils.getRootCauseMessage(e)); return null; } } return null; }  String serialize(Object object); Object fromString(String str); @Deprecated JSON parse(String json); }
JSONTool { public Object fromString(String str) { if (StringUtils.isNotBlank(str)) { ObjectMapper objectMapper = new ObjectMapper(); try { return objectMapper.readValue(str, Object.class); } catch (Exception e) { LOGGER.info("Failed to parse JSON [{}]: {}", StringUtils.abbreviate(str, 32), ExceptionUtils.getRootCauseMessage(e)); return null; } } return null; }  String serialize(Object object); Object fromString(String str); @Deprecated JSON parse(String json);  }