Record Class JsonNode.BooleanNode
java.lang.Object
java.lang.Record
cloud.opencode.base.json.JsonNode.BooleanNode
- All Implemented Interfaces:
JsonNode
- Enclosing interface:
JsonNode
Boolean Node - Represents a JSON boolean.
布尔节点 - 表示 JSON 布尔值。
- Since:
- JDK 25, opencode-base-json V1.0.0
- Author:
- Leon Soo www.LeonSoo.com
-
Nested Class Summary
Nested classes/interfaces inherited from interface JsonNode
JsonNode.ArrayNode, JsonNode.BooleanNode, JsonNode.NullNode, JsonNode.NumberNode, JsonNode.ObjectNode, JsonNode.StringNode -
Constructor Summary
ConstructorsConstructorDescriptionBooleanNode(boolean value) Creates an instance of aBooleanNoderecord class. -
Method Summary
Modifier and TypeMethodDescriptionbooleanasBoolean(boolean defaultValue) Returns this node's value as a boolean with default.intasInt(int defaultValue) Returns this node's value as an int with default.asString()Returns this node's value as a string.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.booleanReturns whether this node is a boolean.final StringtoString()Returns a string representation of this record class.booleanvalue()Returns the value of thevaluerecord component.
-
Constructor Details
-
BooleanNode
public BooleanNode(boolean value) Creates an instance of aBooleanNoderecord class.- Parameters:
value- the value for thevaluerecord component
-
-
Method Details
-
isBoolean
-
asString
-
asBoolean
-
asInt
-
toString
-
hashCode
-
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared with thecomparemethod from their corresponding wrapper classes. -
value
public boolean value()Returns the value of thevaluerecord component.- Returns:
- the value of the
valuerecord component
-