Class JsonBoolean

java.lang.Object
io.helidon.json.JsonValue
io.helidon.json.JsonBoolean

public final class JsonBoolean extends JsonValue
Represents a JSON boolean value (true or false).

This module is incubating. These APIs may change in any version of Helidon, including backward incompatible changes.

  • Field Details

    • FALSE

      public static final JsonBoolean FALSE
      The singleton instance representing the JSON boolean value false.
    • TRUE

      public static final JsonBoolean TRUE
      The singleton instance representing the JSON boolean value true.
  • Method Details

    • create

      public static JsonBoolean create(boolean value)
      Create a JsonBoolean from a boolean value.

      Return the appropriate singleton instance (TRUE or FALSE) for efficiency.

      Parameters:
      value - the boolean value
      Returns:
      the JsonBoolean instance
    • value

      public boolean value()
      Return the boolean value of this JsonBoolean.
      Returns:
      the boolean value
    • type

      public JsonValueType type()
      Description copied from class: JsonValue
      Return the type of this JSON value.
      Specified by:
      type in class JsonValue
      Returns:
      the JsonValueType of this value
    • toJson

      public void toJson(JsonGenerator generator)
      Description copied from class: JsonValue
      Write this JSON value to the provided generator.
      Specified by:
      toJson in class JsonValue
      Parameters:
      generator - the generator to write to