Class JSONObjectValue
- java.lang.Object
-
- com.dynatrace.openkit.util.json.objects.JSONValue
-
- com.dynatrace.openkit.util.json.objects.JSONObjectValue
-
public class JSONObjectValue extends JSONValue
JSON value class representing an object value.
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description booleancontainsKey(java.lang.String key)Returnstrueif and only if the given key is present in this JSON object.static JSONObjectValuefromMap(java.util.Map<java.lang.String,JSONValue> jsonObjectMap)Factory method for creating a newJSONObjectValue.JSONValueget(java.lang.String key)Returns the value to which the specified key is mapped, ornullif this map contains no mapping for the key.booleanisObject()Get a boolean indicating whether this instance represents an JSON object value or not.java.util.Set<java.lang.String>keySet()Returns aSetview of the keys contained in this JSON object.intsize()Get the size of this JSON array.
-
-
-
Method Detail
-
fromMap
public static JSONObjectValue fromMap(java.util.Map<java.lang.String,JSONValue> jsonObjectMap)
Factory method for creating a newJSONObjectValue.- Parameters:
jsonObjectMap- The map storing the keys and values of the JSON object.- Returns:
- Newly created
JSONObjectValueornullif argument is null.
-
isObject
public boolean isObject()
Description copied from class:JSONValueGet a boolean indicating whether this instance represents an JSON object value or not.
-
keySet
public java.util.Set<java.lang.String> keySet()
Returns aSetview of the keys contained in this JSON object.- Returns:
- A set view of the keys contained in this map
-
size
public int size()
Get the size of this JSON array.- Returns:
- Size of this JSON array.
-
containsKey
public boolean containsKey(java.lang.String key)
Returnstrueif and only if the given key is present in this JSON object.- Parameters:
key- The key to test whether it's present or not in this JSON object.- Returns:
trueif the key is present in this JSON object,falseotherwise.
-
get
public JSONValue get(java.lang.String key)
Returns the value to which the specified key is mapped, ornullif this map contains no mapping for the key.- Parameters:
key- the key whose associated JSON value is to be returned- Returns:
- The JSON value this key is associated with or
nullif no such key exists.
-
-