@Test public void toMap() { ObjectValue n = PropertyValue.createObject(""); n.setValue("a", "aVal"); n.addObject("b").addObject("b2").setValue("b3", "b3Val"); ListValue array = n.addList("c"); array.addValue("cVal1"); array.addValue("cVal2"); Map<String,String> map = n.toMap(); System.out.println(map); assertThat(map).hasSize(4); assertThat("aVal").isEqualTo(map.get("a")); assertThat("b3Val").isEqualTo(map.get("b.b2.b3")); assertThat("cVal1").isEqualTo(map.get("c[0]")); assertThat("cVal2").isEqualTo(map.get("c[1]")); }
public Map<String,String> toMap(){ Map<String, String> map = new TreeMap<>(); if(value!=null) { map.put(getQualifiedKey(), value); } return map; }
PropertyValue implements Serializable, Iterable<PropertyValue> { public Map<String,String> toMap(){ Map<String, String> map = new TreeMap<>(); if(value!=null) { map.put(getQualifiedKey(), value); } return map; } }
PropertyValue implements Serializable, Iterable<PropertyValue> { public Map<String,String> toMap(){ Map<String, String> map = new TreeMap<>(); if(value!=null) { map.put(getQualifiedKey(), value); } return map; } PropertyValue(String key); protected  PropertyValue(String key, String value); }
PropertyValue implements Serializable, Iterable<PropertyValue> { public Map<String,String> toMap(){ Map<String, String> map = new TreeMap<>(); if(value!=null) { map.put(getQualifiedKey(), value); } return map; } PropertyValue(String key); protected  PropertyValue(String key, String value); static ObjectValue createObject(); static ListValue createList(); static PropertyValue createValue(String key, String value); static ListValue createList(String key); static ObjectValue createObject(String key); static Map<String, PropertyValue> mapProperties(Map<String, String> config, String source); static Map<String, PropertyValue> mapProperties(Map<String, String> config, String source,
                                                           Map<String,String> metaData); static Map<String, PropertyValue> mapProperties(Map<String, String> config, String source,
                                                           Map<String,String> metaData, String prefix); final boolean isImmutable(); PropertyValue immutable(); PropertyValue mutable(); ValueType getValueType(); final String getKey(); String getValue(); @Deprecated String getSource(); PropertyValue setValue(String value); String getQualifiedKey(); final PropertyValue getParent(); final int getVersion(); final boolean isRoot(); final boolean isLeaf(); final Map<String, String> getMeta(); @Deprecated String getMetaEntry(String key); final T getMeta(String key); int getSize(); @Override Iterator<PropertyValue> iterator(); final PropertyValue setMeta(Map<String, String> metaEntries); final PropertyValue setMeta(String key, Object value); final PropertyValue removeMeta(String key); Map<String,String> toMap(); Map<String,String> toLocalMap(); @Override String toString(); ObjectValue toObjectValue(); ListValue toListValue(); PropertyValue setKey(String key); @Override boolean equals(Object o); @Override int hashCode(); }
PropertyValue implements Serializable, Iterable<PropertyValue> { public Map<String,String> toMap(){ Map<String, String> map = new TreeMap<>(); if(value!=null) { map.put(getQualifiedKey(), value); } return map; } PropertyValue(String key); protected  PropertyValue(String key, String value); static ObjectValue createObject(); static ListValue createList(); static PropertyValue createValue(String key, String value); static ListValue createList(String key); static ObjectValue createObject(String key); static Map<String, PropertyValue> mapProperties(Map<String, String> config, String source); static Map<String, PropertyValue> mapProperties(Map<String, String> config, String source,
                                                           Map<String,String> metaData); static Map<String, PropertyValue> mapProperties(Map<String, String> config, String source,
                                                           Map<String,String> metaData, String prefix); final boolean isImmutable(); PropertyValue immutable(); PropertyValue mutable(); ValueType getValueType(); final String getKey(); String getValue(); @Deprecated String getSource(); PropertyValue setValue(String value); String getQualifiedKey(); final PropertyValue getParent(); final int getVersion(); final boolean isRoot(); final boolean isLeaf(); final Map<String, String> getMeta(); @Deprecated String getMetaEntry(String key); final T getMeta(String key); int getSize(); @Override Iterator<PropertyValue> iterator(); final PropertyValue setMeta(Map<String, String> metaEntries); final PropertyValue setMeta(String key, Object value); final PropertyValue removeMeta(String key); Map<String,String> toMap(); Map<String,String> toLocalMap(); @Override String toString(); ObjectValue toObjectValue(); ListValue toListValue(); PropertyValue setKey(String key); @Override boolean equals(Object o); @Override int hashCode();  }