elemental.json.impl.
Class JreJsonBoolean
- java.lang.Object
-
- elemental.json.impl.JreJsonValue
-
- elemental.json.impl.JreJsonBoolean
-
All Implemented Interfaces:
public class JreJsonBoolean extends JreJsonValue implements JsonBoolean
Server-side implementation of JsonBoolean.
See Also:
-
-
Constructor Summary
Constructors Constructor Description JreJsonBoolean(boolean bool)
-
Method Summary
All Methods Modifier and Type Method Description boolean
asBoolean()
Coerces underlying value to boolean according to the rules of Javascript coercion.
double
asNumber()
Coerces the underlying value to a number according to the rules of Javascript coercion.
String
asString()
Coerces the underlying value to a String according to the rules of JavaScript coercion.
boolean
getBoolean()
Object
getObject()
JsonType
getType()
Returns an enumeration representing the fundamental JSON type.
boolean
jsEquals(JsonValue value)
Equivalent of Javascript '==' operator comparison between two values.
String
toJson()
Returns a serialized JSON string representing this value.
void
traverse(elemental.json.impl.JsonVisitor visitor, elemental.json.impl.JsonContext ctx)
-
Methods inherited from class elemental.json.impl.JreJsonValue
parseJson, toNative
-
-
-
-
Method Detail
-
asBoolean
public boolean asBoolean()
Description copied from interface:
JsonValue
Coerces underlying value to boolean according to the rules of Javascript coercion.
-
asNumber
public double asNumber()
Description copied from interface:
JsonValue
Coerces the underlying value to a number according to the rules of Javascript coercion.
-
asString
public String asString()
Description copied from interface:
JsonValue
Coerces the underlying value to a String according to the rules of JavaScript coercion.
-
getBoolean
public boolean getBoolean()
Specified by:
getBoolean
in interfaceJsonBoolean
-
getObject
public Object getObject()
Specified by:
getObject
in classJreJsonValue
-
getType
public JsonType getType()
Description copied from interface:
JsonValue
Returns an enumeration representing the fundamental JSON type.
-
jsEquals
public boolean jsEquals(JsonValue value)
Description copied from interface:
JsonValue
Equivalent of Javascript '==' operator comparison between two values.
-
traverse
public void traverse(elemental.json.impl.JsonVisitor visitor, elemental.json.impl.JsonContext ctx)
Specified by:
traverse
in classJreJsonValue
-
toJson
public String toJson() throws IllegalStateException
Description copied from interface:
JsonValue
Returns a serialized JSON string representing this value.
Specified by:
Returns:
Throws:
-
-