public enum JSONLiteral extends java.lang.Enum<JSONLiteral>
Enum Constant and Description |
---|
FALSE
The false literal string.
|
NULL
The null literal string.
|
TRUE
The true literal string.
|
Modifier and Type | Method and Description |
---|---|
boolean |
equals(java.lang.String str)
Check if a passed in string matches the literal's value.
|
static JSONLiteral |
fromString(java.lang.String str)
Get a JSONLiteral from a string.
|
java.lang.String |
toString()
Returns a string representation of the object.
|
java.lang.String |
value()
Get our literal value.
|
static JSONLiteral |
valueOf(java.lang.String name)
Returns the enum constant of this type with the specified name.
|
static JSONLiteral[] |
values()
Returns an array containing the constants of this enum type, in
the order they are declared.
|
public static final JSONLiteral NULL
public static final JSONLiteral TRUE
public static final JSONLiteral FALSE
public static JSONLiteral[] values()
for (JSONLiteral c : JSONLiteral.values()) System.out.println(c);
public static JSONLiteral valueOf(java.lang.String name)
name
- the name of the enum constant to be returned.java.lang.IllegalArgumentException
- if this enum type has no constant with the specified namejava.lang.NullPointerException
- if the argument is nullpublic java.lang.String value()
public java.lang.String toString()
toString
in class java.lang.Enum<JSONLiteral>
public boolean equals(java.lang.String str)
str
- string to checktrue
if the string matches,
false
if notpublic static JSONLiteral fromString(java.lang.String str) throws JSONException
str
- string containing a JSON literal valueJSONException
- if the string does not match a JSON
literal value