ezvcard.io.json
Class JsonValue

java.lang.Object
  extended by ezvcard.io.json.JsonValue

public class JsonValue
extends Object

Represents a JSON value, array, or object.

Author:
Michael Angstadt

Constructor Summary
JsonValue(List<JsonValue> array)
          Creates a JSON array.
JsonValue(Map<String,JsonValue> object)
          Creates a JSON object.
JsonValue(Object value)
          Creates a JSON value (such as a string or integer).
 
Method Summary
 boolean equals(Object obj)
           
 List<JsonValue> getArray()
          Gets the JSON array elements.
 Map<String,JsonValue> getObject()
          Gets the JSON object.
 Object getValue()
          Gets the JSON value.
 int hashCode()
           
 boolean isNull()
          Determines if the value is "null" or not.
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

JsonValue

public JsonValue(Object value)
Creates a JSON value (such as a string or integer).

Parameters:
value - the value

JsonValue

public JsonValue(List<JsonValue> array)
Creates a JSON array.

Parameters:
array - the array elements

JsonValue

public JsonValue(Map<String,JsonValue> object)
Creates a JSON object.

Parameters:
object - the object fields
Method Detail

getValue

public Object getValue()
Gets the JSON value.

Returns:
the value or null if it's not a JSON value

getArray

public List<JsonValue> getArray()
Gets the JSON array elements.

Returns:
the array elements or null if it's not a JSON array

getObject

public Map<String,JsonValue> getObject()
Gets the JSON object.

Returns:
the object or null if it's not a JSON object

isNull

public boolean isNull()
Determines if the value is "null" or not.

Returns:
true if the value is "null", false if not

hashCode

public int hashCode()
Overrides:
hashCode in class Object

equals

public boolean equals(Object obj)
Overrides:
equals in class Object

toString

public String toString()
Overrides:
toString in class Object


Copyright © 2012-2014 Michael Angstadt. All Rights Reserved.