Exemplo n.º 1
0
 public static StringToStringMap fromXml(StringToStringMapConfig nsMapping) {
   StringToStringMap result = new StringToStringMap();
   for (Entry entry : nsMapping.getEntryList()) {
     result.put(entry.getKey(), entry.getValue());
   }
   return result;
 }
Exemplo n.º 2
0
  public String toXml() {
    StringToStringMapConfig xmlConfig = StringToStringMapConfig.Factory.newInstance();

    for (String key : keySet()) {
      Entry entry = xmlConfig.addNewEntry();
      entry.setKey(key);
      entry.setValue(get(key));
    }

    return xmlConfig.toString();
  }