com.sdicons.json.model
Class JSONBoolean

java.lang.Object
  extended by com.sdicons.json.model.JSONValue
      extended by com.sdicons.json.model.JSONSimple
          extended by com.sdicons.json.model.JSONBoolean

public class JSONBoolean
extends JSONSimple

Represents a JSON boolean value. Examples are: true, false.


Field Summary
static JSONBoolean FALSE
           
static JSONBoolean TRUE
           
 
Constructor Summary
JSONBoolean(boolean value)
           
 
Method Summary
 boolean equals(Object o)
           
 boolean getValue()
           
 int hashCode()
           
protected  String render(boolean pretty, String indent)
          Convert the JSON value into a string representation (JSON representation).
 Object strip()
          Get the Java object, remove all JSON information.
 String toString()
           
 
Methods inherited from class com.sdicons.json.model.JSONValue
decorate, getCol, getData, getLine, getStreamName, isArray, isBoolean, isComplex, isDecimal, isInteger, isNull, isNumber, isObject, isSimple, isString, render, setData, setLineCol, setStreamName
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

TRUE

public static final JSONBoolean TRUE

FALSE

public static final JSONBoolean FALSE
Constructor Detail

JSONBoolean

public JSONBoolean(boolean value)
Method Detail

getValue

public boolean getValue()

toString

public String toString()
Overrides:
toString in class Object

render

protected String render(boolean pretty,
                        String indent)
Description copied from class: JSONValue
Convert the JSON value into a string representation (JSON representation).

Specified by:
render in class JSONValue
Parameters:
pretty - Indicating if the print should be made pretty (human readers) or compact (transmission or storage).
indent - Starting indent.
Returns:
A JSON representation.

equals

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

hashCode

public int hashCode()
Overrides:
hashCode in class Object

strip

public Object strip()
Get the Java object, remove all JSON information. In the case of a JSONBoolean, this is a Java Boolean object.

Specified by:
strip in class JSONValue
Returns:
Boolean.TRUE or Boolean.FALSE depending on the value of the JSONBoolean.


Copyright © 2011. All Rights Reserved.