Enum Class JsonKind

java.lang.Object
java.lang.Enum<JsonKind>
ca.marcusdunn.jsonlens.model.JsonKind
All Implemented Interfaces:
Serializable, Comparable<JsonKind>, Constable

public enum JsonKind extends Enum<JsonKind>

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.

  • Enum Constant Details

    • OBJECT

      public static final JsonKind OBJECT
      An unordered collection of members (name/value pairs).
    • ARRAY

      public static final JsonKind ARRAY
      An ordered sequence of elements.
    • STRING

      public static final JsonKind STRING
      A sequence of Unicode scalar values.
    • NUMBER

      public static final JsonKind NUMBER
      A decimal number.
    • TRUE

      public static final JsonKind TRUE
      The literal true.
    • FALSE

      public static final JsonKind FALSE
      The literal false.
    • NULL

      public static final JsonKind NULL
      The literal null.
  • Method Details

    • values

      public static JsonKind[] 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

      public static JsonKind valueOf(String name)
      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 name
      NullPointerException - 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