Class StringMap
- java.lang.Object
-
- java.util.AbstractMap<K,V>
-
- java.util.HashMap<String,Object>
-
- org.xwiki.livedata.rest.model.jaxb.StringMap
-
- All Implemented Interfaces:
Serializable
,Cloneable
,Map<String,Object>
public class StringMap extends HashMap<String,Object>
A Java equivalent of a JSON map.We don't generate this class from the schema because we need the
XmlJavaTypeAdapter
annotation. We tried various ways to add theXmlJavaTypeAdapter
annotation to the schema-generated class from the separate bindings file but none succeeded.- Since:
- 12.10
- Version:
- $Id: 7f0e10aa1db08d0c0c9006b45e6a734c56fc608b $
- See Also:
- Serialized Form
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class java.util.AbstractMap
AbstractMap.SimpleEntry<K extends Object,V extends Object>, AbstractMap.SimpleImmutableEntry<K extends Object,V extends Object>
-
-
Constructor Summary
Constructors Constructor Description StringMap()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static StringMap
fromMap(Map<?,?> map)
Converts a generic map to a string map.static StringMap
fromString(String json)
Parses the given JSON representation of a string map.String
toString()
-
Methods inherited from class java.util.HashMap
clear, clone, compute, computeIfAbsent, computeIfPresent, containsKey, containsValue, entrySet, forEach, get, getOrDefault, isEmpty, keySet, merge, put, putAll, putIfAbsent, remove, remove, replace, replace, replaceAll, size, values
-
Methods inherited from class java.util.AbstractMap
equals, hashCode
-
-
-
-
Method Detail
-
fromString
public static StringMap fromString(String json)
Parses the given JSON representation of a string map.- Parameters:
json
- a serialized JSON object (the equivalent of a JavaMap
).- Returns:
- the corresponding
StringMap
instance - See Also:
- Inject custom Java types via JSX-RS parameter annotations
-
fromMap
public static StringMap fromMap(Map<?,?> map)
Converts a generic map to a string map.- Parameters:
map
- the generic map to take the entries from- Returns:
- the string map
-
toString
public String toString()
- Overrides:
toString
in classAbstractMap<String,Object>
-
-