Enum Class JSONLiteral

java.lang.Object
java.lang.Enum<JSONLiteral>
org.tquadrat.foundation.jsonbuilder.JSONLiteral
All Implemented Interfaces:
Serializable, Comparable<JSONLiteral>, Constable, Formattable, JSONValue

@ClassVersion(sourceVersion="$Id: JSONLiteral.java 1258 2026-06-04 18:33:06Z tquadrat $") @API(status=STABLE, since="0.1.0") public enum JSONLiteral extends Enum<JSONLiteral> implements JSONValue

The representation of the JSON literals. These are

Author:
Thomas Thrien (thomas.thrien@tquadrat.org)
Version:
$Id: JSONLiteral.java 1258 2026-06-04 18:33:06Z tquadrat $
Since:
0.1.0
UML Diagram
UML Diagram for "org.tquadrat.foundation.jsonbuilder.JSONLiteral"

UML Diagram for "org.tquadrat.foundation.jsonbuilder.JSONLiteral"

UML Diagram for "org.tquadrat.foundation.jsonbuilder.JSONLiteral"
  • Enum Constant Details

    • NULL

      public static final JSONLiteral NULL
      Represents the JSON literal null.
    • TRUE

      public static final JSONLiteral TRUE
      Represents the JSON literal true.
    • FALSE

      public static final JSONLiteral FALSE
      Represents the JSON literal false.
  • Field Details

    • m_Value

      private final String m_Value
      The value for the literal.
  • Constructor Details

    • JSONLiteral

      private JSONLiteral(String value)
      Creates a new instance of JSONLiteral.
      Parameters:
      value - The value.
  • Method Details

    • values

      public static JSONLiteral[] 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 JSONLiteral 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
    • formatTo

      public final void formatTo(Formatter formatter, int flags, int width, int precision)
      Specified by:
      formatTo in interface Formattable
      Specified by:
      formatTo in interface JSONValue
    • isBoolean

      public final boolean isBoolean()

      Detects whether this value represents a boolean value.

      Specified by:
      isBoolean in interface JSONValue
      Returns:
      true if this value represents either the JSON literal true or FALSE.
    • toString

      public final String toString()
      Specified by:
      toString in interface JSONValue
      Overrides:
      toString in class Enum<JSONLiteral>