public class JsonPrimitive extends JsonElement
| Modifier and Type | Field and Description |
|---|---|
static JsonPrimitive |
FALSE
Convenience instance of json "false".
|
static JsonPrimitive |
TRUE
Convenience instance of json "true".
|
| Constructor and Description |
|---|
JsonPrimitive(java.lang.Object value) |
| Modifier and Type | Method and Description |
|---|---|
boolean |
asBoolean(boolean defaultValue) |
byte |
asByte(byte defaultValue) |
char |
asChar(char defaultValue) |
double |
asDouble(double defaultValue) |
float |
asFloat(float defaultValue) |
int |
asInt(int defaultValue) |
long |
asLong(long defaultValue) |
short |
asShort(short defaultValue) |
java.lang.String |
asString() |
JsonPrimitive |
clone() |
boolean |
equals(java.lang.Object other) |
static java.lang.String |
escape(java.lang.String s) |
java.lang.Object |
getValue() |
int |
hashCode() |
java.lang.String |
toJson(boolean comments,
boolean newlines,
int depth) |
java.lang.String |
toJson(JsonGrammar grammar,
int depth) |
java.lang.String |
toString() |
toJson, toJson, toJsonpublic static JsonPrimitive TRUE
public static JsonPrimitive FALSE
@Nonnull public java.lang.String asString()
public boolean asBoolean(boolean defaultValue)
public byte asByte(byte defaultValue)
public char asChar(char defaultValue)
public short asShort(short defaultValue)
public int asInt(int defaultValue)
public long asLong(long defaultValue)
public float asFloat(float defaultValue)
public double asDouble(double defaultValue)
@Nonnull public java.lang.String toString()
toString in class java.lang.Object@Nonnull public java.lang.Object getValue()
public boolean equals(java.lang.Object other)
equals in class java.lang.Objectpublic int hashCode()
hashCode in class java.lang.Objectpublic static java.lang.String escape(java.lang.String s)
public java.lang.String toJson(boolean comments,
boolean newlines,
int depth)
toJson in class JsonElementpublic java.lang.String toJson(JsonGrammar grammar, int depth)
toJson in class JsonElementpublic JsonPrimitive clone()
clone in class JsonElement