@Test public void parseStringToObjectWithXmlSpec() { Variable variable = new Variable(); variable.setId(20L); variable.setKey("Name"); variable.setValue("valueName"); String parse = xmlParser.parse(variable); assertNotNull(parse); assertEquals("<Variable><id>20</id><key>Name</key><value>valueName</value><environment/></Variable>", parse); }
@Override public <T> String parse(T object) { try { return mapper().writeValueAsString(object); } catch (JsonProcessingException e) { log.error(e.getMessage(), e); return null; } }
XmlImpl implements Xml { @Override public <T> String parse(T object) { try { return mapper().writeValueAsString(object); } catch (JsonProcessingException e) { log.error(e.getMessage(), e); return null; } } }
XmlImpl implements Xml { @Override public <T> String parse(T object) { try { return mapper().writeValueAsString(object); } catch (JsonProcessingException e) { log.error(e.getMessage(), e); return null; } }  }
XmlImpl implements Xml { @Override public <T> String parse(T object) { try { return mapper().writeValueAsString(object); } catch (JsonProcessingException e) { log.error(e.getMessage(), e); return null; } }  @Override String parse(T object); @SuppressWarnings("unchecked") @Override T parse(String xml, Class<?> classType); }
XmlImpl implements Xml { @Override public <T> String parse(T object) { try { return mapper().writeValueAsString(object); } catch (JsonProcessingException e) { log.error(e.getMessage(), e); return null; } }  @Override String parse(T object); @SuppressWarnings("unchecked") @Override T parse(String xml, Class<?> classType);  }