Class TypedMapWrapper
- java.lang.Object
-
- java.util.AbstractMap<String,Object>
-
- org.apache.jackrabbit.vault.rcp.impl.TypedMapWrapper
-
public class TypedMapWrapper extends AbstractMap<String,Object> implements Map<String,Object>
Adds helper methods to a wrapped Map containing objects of different types. Those additional getter methods allow to retrieve a specific typed value. The method names are inspired by org.apache.sling.commons.json.JSONObject.
-
-
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 TypedMapWrapper(Map<String,Object> wrappedMap)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Set<Map.Entry<String,Object>>
entrySet()
boolean
getBoolean(String key)
int
getInt(String key)
long
getLong(String key)
String
getString(String key)
List<String>
getStringList(String key)
boolean
optBoolean(String key, boolean defaultValue)
int
optInt(String key, int defaultValue)
String
optString(String key, String defaultValue)
-
Methods inherited from class java.util.AbstractMap
clear, clone, containsKey, containsValue, equals, get, hashCode, isEmpty, keySet, put, putAll, remove, size, toString, values
-
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface java.util.Map
clear, compute, computeIfAbsent, computeIfPresent, containsKey, containsValue, equals, forEach, get, getOrDefault, hashCode, isEmpty, keySet, merge, put, putAll, putIfAbsent, remove, remove, replace, replace, replaceAll, size, values
-
-
-
-
Method Detail
-
getLong
public long getLong(String key) throws IllegalArgumentException
- Throws:
IllegalArgumentException
-
getBoolean
public boolean getBoolean(String key) throws IllegalArgumentException
- Throws:
IllegalArgumentException
-
optBoolean
public boolean optBoolean(String key, boolean defaultValue)
-
getInt
public int getInt(String key) throws IllegalArgumentException
- Throws:
IllegalArgumentException
-
optInt
public int optInt(String key, int defaultValue)
-
-