Class 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
      boolean containsKey​(java.lang.String key)
      Returns true if and only if the given key is present in this JSON object.
      static JSONObjectValue fromMap​(java.util.Map<java.lang.String,​JSONValue> jsonObjectMap)
      Factory method for creating a new JSONObjectValue.
      JSONValue get​(java.lang.String key)
      Returns the value to which the specified key is mapped, or null if this map contains no mapping for the key.
      boolean isObject()
      Get a boolean indicating whether this instance represents an JSON object value or not.
      java.util.Set<java.lang.String> keySet()
      Returns a Set view of the keys contained in this JSON object.
      int size()
      Get the size of this JSON array.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • Method Detail

      • fromMap

        public static JSONObjectValue fromMap​(java.util.Map<java.lang.String,​JSONValue> jsonObjectMap)
        Factory method for creating a new JSONObjectValue.
        Parameters:
        jsonObjectMap - The map storing the keys and values of the JSON object.
        Returns:
        Newly created JSONObjectValue or null if argument is null.
      • isObject

        public boolean isObject()
        Description copied from class: JSONValue
        Get a boolean indicating whether this instance represents an JSON object value or not.
        Overrides:
        isObject in class JSONValue
        Returns:
        true for objects representing an object value, false otherwise.
      • keySet

        public java.util.Set<java.lang.String> keySet()
        Returns a Set view 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)
        Returns true if 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:
        true if the key is present in this JSON object, false otherwise.
      • get

        public JSONValue get​(java.lang.String key)
        Returns the value to which the specified key is mapped, or null if 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 null if no such key exists.