io.replay.framework
Class ReplayJsonObject

java.lang.Object
  extended by org.json.JSONObject
      extended by io.replay.framework.ReplayJsonObject
All Implemented Interfaces:
java.io.Serializable, java.lang.Iterable<java.lang.String>

public class ReplayJsonObject
extends org.json.JSONObject
implements java.lang.Iterable<java.lang.String>, java.io.Serializable

Convenience class created to facilitate the mapping of String to Object. This class extends JSONObject and implements Iterable, allowing the user to non-deterministically iterate through the KeySet of this object.

See Also:
Serialized Form

Field Summary
 
Fields inherited from class org.json.JSONObject
NULL
 
Method Summary
 boolean equals(java.lang.Object o)
           
 java.lang.Object get(java.lang.String name)
           
 boolean getBoolean(java.lang.String name)
          Returns the value mapped by name if it exists and is a boolean or can be coerced to a boolean, or false otherwise.
 double getDouble(java.lang.String name)
          Returns the value mapped by name if it exists and is a double or can be coerced to a double, or Double.NaN otherwise.
 int getInt(java.lang.String name)
          Returns the value mapped by name if it exists and is an integer or can be coerced to an integer, or Integer.MIN_VALUE otherwise.
 long getLong(java.lang.String name)
          Returns the value mapped by name if it exists and is a long or can be coerced to a long, or Long.MIN_VALUE otherwise.
 java.lang.String getString(java.lang.String name)
          Returns the value mapped by name if it exists and is a string or can be coerced to a string, or null otherwise.
 int hashCode()
           
 java.util.Iterator<java.lang.String> iterator()
           
 org.json.JSONObject put(java.lang.String name, boolean value)
           
 org.json.JSONObject put(java.lang.String name, double value)
           
 org.json.JSONObject put(java.lang.String name, int value)
           
 org.json.JSONObject put(java.lang.String name, long value)
           
 org.json.JSONObject put(java.lang.String name, java.lang.Object value)
           
 org.json.JSONObject put(java.lang.String name, ReplayJsonObject value)
           
 org.json.JSONObject put(java.lang.String name, java.lang.String value)
           
 
Methods inherited from class org.json.JSONObject
accumulate, getJSONArray, getJSONObject, has, isNull, keys, length, names, numberToString, opt, optBoolean, optBoolean, optDouble, optDouble, optInt, optInt, optJSONArray, optJSONObject, optLong, optLong, optString, optString, putOpt, quote, remove, toJSONArray, toString, toString, wrap
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Method Detail

put

public org.json.JSONObject put(java.lang.String name,
                               boolean value)
Overrides:
put in class org.json.JSONObject

put

public org.json.JSONObject put(java.lang.String name,
                               double value)
Overrides:
put in class org.json.JSONObject

put

public org.json.JSONObject put(java.lang.String name,
                               int value)
Overrides:
put in class org.json.JSONObject

put

public org.json.JSONObject put(java.lang.String name,
                               long value)
Overrides:
put in class org.json.JSONObject

put

public org.json.JSONObject put(java.lang.String name,
                               java.lang.Object value)
Overrides:
put in class org.json.JSONObject

put

public org.json.JSONObject put(java.lang.String name,
                               java.lang.String value)

put

public org.json.JSONObject put(java.lang.String name,
                               ReplayJsonObject value)

get

public java.lang.Object get(java.lang.String name)
Overrides:
get in class org.json.JSONObject

getBoolean

public boolean getBoolean(java.lang.String name)
Returns the value mapped by name if it exists and is a boolean or can be coerced to a boolean, or false otherwise.

Overrides:
getBoolean in class org.json.JSONObject
Returns:
the resulting mapping, or false otherwise.

getDouble

public double getDouble(java.lang.String name)
Returns the value mapped by name if it exists and is a double or can be coerced to a double, or Double.NaN otherwise.

Overrides:
getDouble in class org.json.JSONObject
Returns:
the resulting mapping or Double.NaN otherwise.

getInt

public int getInt(java.lang.String name)
Returns the value mapped by name if it exists and is an integer or can be coerced to an integer, or Integer.MIN_VALUE otherwise.

Overrides:
getInt in class org.json.JSONObject
Returns:
the resulting mapping or Integer.MIN_VALUE otherwise.

getLong

public long getLong(java.lang.String name)
Returns the value mapped by name if it exists and is a long or can be coerced to a long, or Long.MIN_VALUE otherwise.

Overrides:
getLong in class org.json.JSONObject
Returns:
the resulting mapping or Long.MIN_VALUE otherwise.

getString

public java.lang.String getString(java.lang.String name)
Returns the value mapped by name if it exists and is a string or can be coerced to a string, or null otherwise.

Overrides:
getString in class org.json.JSONObject
Returns:
the resulting mapping or null otherwise.

hashCode

public int hashCode()
Overrides:
hashCode in class java.lang.Object

equals

public boolean equals(java.lang.Object o)
Overrides:
equals in class java.lang.Object

iterator

public java.util.Iterator<java.lang.String> iterator()
Specified by:
iterator in interface java.lang.Iterable<java.lang.String>