Class JsonBoolean
java.lang.Object
io.helidon.json.JsonValue
io.helidon.json.JsonBoolean
Represents a JSON boolean value (true or false).
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final JsonBooleanThe singleton instance representing the JSON boolean value false.static final JsonBooleanThe singleton instance representing the JSON boolean value true. -
Method Summary
Modifier and TypeMethodDescriptionstatic JsonBooleancreate(boolean value) Create a JsonBoolean from a boolean value.voidtoJson(JsonGenerator generator) Write this JSON value to the provided generator.type()Return the type of this JSON value.booleanvalue()Return the boolean value of this JsonBoolean.Methods inherited from class JsonValue
asArray, asBoolean, asNumber, asObject, asString, objectBuilder, toStringModifier and TypeMethodDescriptionasArray()Cast this value to a JsonArray if it is of array type.Cast this value to a JsonBoolean if it is of boolean type.asNumber()Cast this value to a JsonNumber if it is of number type.asObject()Cast this value to a JsonObject if it is of object type.asString()Cast this value to a JsonString if it is of string type.static JsonObject.BuilderA new fluent API builder to construct anJsonObject.toString()
-
Field Details
-
FALSE
The singleton instance representing the JSON boolean value false. -
TRUE
The singleton instance representing the JSON boolean value true.
-
-
Method Details
-
create
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
Description copied from class:JsonValueReturn the type of this JSON value. -
toJson
Description copied from class:JsonValueWrite this JSON value to the provided generator.
-