Class MapObject
Object
MapObject
- Direct Known Subclasses:
SpecParams
A wrapper for a Map-based structure.
It is a wrapper around JSONObject, which is a wrapper around Map. Compensating some of the JSONObject deficiencies. Made all methods optional.
todo maybe get rid of using JSONObject - depends on the further development and usage
Problems:
1. If underlying map contains another Map as a value, JSONObject.getObject() won't return JSONObject.
2. Awkward iteration of keys in JSONObject
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanstatic MapObjectbooleangetBoolean(String key) booleangetBoolean(String key, boolean defaultValue) intintgetIntList(String key) <T> List<T>longlonggetLongList(String key) getObjectList(String key) getRawObjectList(String key) getStringList(String key) booleaninthashCode()booleanisEmpty()keys()toString()static <T> List<T>
-
Field Details
-
EMPTY
-
MAP_OBJECT_ARRAY_EXTRACTOR
-
myObject
@NotNull protected final JSONObject myObject -
myMapView
-
-
Constructor Details
-
MapObject
public MapObject(JSONObject object) -
MapObject
-
-
Method Details
-
from
-
transform
-
isEmpty
public boolean isEmpty() -
has
-
getObject
- Parameters:
name-- Returns:
- sub-object at key or empty MapObject
-
traverse
-
keys
-
get
-
getString
-
getLong
-
getLong
-
getInt
-
getInt
-
getBoolean
-
getBoolean
-
getLongList
-
getIntList
-
getStringList
-
getRawObjectList
-
getObjectList
-
getList
-
asImmutableMap
-
toString
-
equals
-
hashCode
public int hashCode()
-