Enum Class JsonKind
- All Implemented Interfaces:
Serializable, Comparable<JsonKind>, Constable
The kind of a JSON value, as RFC 8259 defines it.
The two boolean values are separate kinds, so that one call to
JsonModel.kind(Object) gives the full value of a boolean node.
-
Nested Class Summary
Nested classes/interfaces inherited from class Enum
Enum.EnumDesc<E> -
Enum Constant Summary
Enum Constants -
Method Summary
Modifier and TypeMethodDescriptionbooleanReturns true for a string, number, true, false, or null.booleanReturns true for an object or an array.static JsonKindReturns the enum constant of this class with the specified name.static JsonKind[]values()Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
OBJECT
An unordered collection of members (name/value pairs). -
ARRAY
An ordered sequence of elements. -
STRING
A sequence of Unicode scalar values. -
NUMBER
A decimal number. -
TRUE
The literaltrue. -
FALSE
The literalfalse. -
NULL
The literalnull.
-
-
Method Details
-
values
Returns an array containing the constants of this enum class, in the order they are declared.- Returns:
- an array containing the constants of this enum class, in the order they are declared
-
valueOf
Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)- Parameters:
name- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException- if this enum class has no constant with the specified nameNullPointerException- if the argument is null
-
isStructured
public boolean isStructured()Returns true for an object or an array.- Returns:
- true if values of this kind can have children
-
isPrimitive
public boolean isPrimitive()Returns true for a string, number, true, false, or null.- Returns:
- true if values of this kind have no children
-