Record Class JsonNode.StringNode
java.lang.Object
java.lang.Record
cloud.opencode.base.json.JsonNode.StringNode
- All Implemented Interfaces:
JsonNode
- Enclosing interface:
JsonNode
String Node - Represents a JSON string.
字符串节点 - 表示 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
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanasBoolean(boolean defaultValue) Returns this node's value as a boolean with default.doubleasDouble(double defaultValue) Returns this node's value as a double with default.intasInt(int defaultValue) Returns this node's value as an int with default.longasLong(long defaultValue) Returns this node's value as a long 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.booleanisString()Returns whether this node is a string.final StringtoString()Returns a string representation of this record class.value()Returns the value of thevaluerecord component.
-
Constructor Details
-
StringNode
Creates an instance of aStringNoderecord class.- Parameters:
value- the value for thevaluerecord component
-
-
Method Details
-
isString
-
asString
-
asInt
-
asLong
-
asDouble
-
asBoolean
-
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 withObjects::equals(Object,Object). -
value
Returns the value of thevaluerecord component.- Returns:
- the value of the
valuerecord component
-