@Test public void marshalNull() throws Exception { assertThat(adapter.marshal(null)).isNull(); }
@Override public ConfigProperties marshal(Map<String, String> map) throws Exception { if (map == null) return null; ConfigProperties configProperties = new ConfigProperties(); for (Map.Entry<String, String> entry : map.entrySet()) { String key = entry.getKey(); String value = entry.getValue(); JAXBElement<String> element = new JAXBElement<>(new QName(key), String.class, value); configProperties.getProperties().add(element); } return configProperties; }
MapAdapter extends XmlAdapter<ConfigProperties, Map<String, String>> { @Override public ConfigProperties marshal(Map<String, String> map) throws Exception { if (map == null) return null; ConfigProperties configProperties = new ConfigProperties(); for (Map.Entry<String, String> entry : map.entrySet()) { String key = entry.getKey(); String value = entry.getValue(); JAXBElement<String> element = new JAXBElement<>(new QName(key), String.class, value); configProperties.getProperties().add(element); } return configProperties; } }
MapAdapter extends XmlAdapter<ConfigProperties, Map<String, String>> { @Override public ConfigProperties marshal(Map<String, String> map) throws Exception { if (map == null) return null; ConfigProperties configProperties = new ConfigProperties(); for (Map.Entry<String, String> entry : map.entrySet()) { String key = entry.getKey(); String value = entry.getValue(); JAXBElement<String> element = new JAXBElement<>(new QName(key), String.class, value); configProperties.getProperties().add(element); } return configProperties; }  }
MapAdapter extends XmlAdapter<ConfigProperties, Map<String, String>> { @Override public ConfigProperties marshal(Map<String, String> map) throws Exception { if (map == null) return null; ConfigProperties configProperties = new ConfigProperties(); for (Map.Entry<String, String> entry : map.entrySet()) { String key = entry.getKey(); String value = entry.getValue(); JAXBElement<String> element = new JAXBElement<>(new QName(key), String.class, value); configProperties.getProperties().add(element); } return configProperties; }  @Override Map<String, String> unmarshal(ConfigProperties configProperties); @Override ConfigProperties marshal(Map<String, String> map); }
MapAdapter extends XmlAdapter<ConfigProperties, Map<String, String>> { @Override public ConfigProperties marshal(Map<String, String> map) throws Exception { if (map == null) return null; ConfigProperties configProperties = new ConfigProperties(); for (Map.Entry<String, String> entry : map.entrySet()) { String key = entry.getKey(); String value = entry.getValue(); JAXBElement<String> element = new JAXBElement<>(new QName(key), String.class, value); configProperties.getProperties().add(element); } return configProperties; }  @Override Map<String, String> unmarshal(ConfigProperties configProperties); @Override ConfigProperties marshal(Map<String, String> map);  }