cc.plural.jsonij
Class JSON.True

java.lang.Object
  extended by cc.plural.jsonij.Value
      extended by cc.plural.jsonij.JSON.Boolean
          extended by cc.plural.jsonij.JSON.True
All Implemented Interfaces:
Serializable, Comparable<Value>
Enclosing class:
JSON

public static class JSON.True
extends JSON.Boolean

JSON True Implementation.

See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class cc.plural.jsonij.Value
Value.TYPE
 
Field Summary
static String VALUE
          The String for True.
 
Fields inherited from class cc.plural.jsonij.Value
valueType
 
Method Summary
 boolean equals(Object obj)
           
 boolean getBoolean()
          Finds the boolean representation for the Value.
 int hashCode()
           
protected  Value.TYPE internalType()
          Internal Method to find the internalType for the Object.
 int nestedSize()
          Finds the nested elements under this Value.
 String toJSON()
          Converts the current Value into a JSON String that represents it.
 
Methods inherited from class cc.plural.jsonij.JSON.Boolean
getValue
 
Methods inherited from class cc.plural.jsonij.Value
compareTo, get, get, getDouble, getInt, getNumber, getString, getValueType, has, isNull, size, toString, type, valueKeySet
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

VALUE

public static final String VALUE
The String for True.

Method Detail

internalType

protected Value.TYPE internalType()
Description copied from class: Value
Internal Method to find the internalType for the Object. Must be implemented and not return null.

Specified by:
internalType in class Value
Returns:
The internalType of this JSON Value.

getBoolean

public boolean getBoolean()
Description copied from class: Value
Finds the boolean representation for the Value. If the value is JSON.TRUE or JSON.FALSE then those booleans are returned. If the value is Numeric then true is returned for all values that are not zero. If the value is a String then an empty String returns 0. If the value is an Object or Array then all sizes that are not zero return true.

Overrides:
getBoolean in class Value
Returns:
boolean The boolean for the Value.

nestedSize

public int nestedSize()
Description copied from class: Value
Finds the nested elements under this Value. This is effectively the count of all JSON Values attached to this Value. This number does not include this value itself.

Specified by:
nestedSize in class Value
Returns:
int The count of all Values attached to this Value.

toJSON

public String toJSON()
Description copied from class: Value
Converts the current Value into a JSON String that represents it.

Specified by:
toJSON in class Value
Returns:
The JSON Value as JSON String.

hashCode

public int hashCode()
Overrides:
hashCode in class Value

equals

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


Copyright © 2012. All Rights Reserved.