Record Class JsonNode.NumberNode
java.lang.Object
java.lang.Record
cloud.opencode.base.json.JsonNode.NumberNode
- All Implemented Interfaces:
JsonNode
- Enclosing interface:
JsonNode
Number Node - Represents a JSON number.
数字节点 - 表示 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 -
Field Summary
Fields inherited from interface JsonNode
OF_MAX_DEPTH -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionReturns this node's value as a BigDecimal.Returns this node's value as a BigInteger.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.booleanisNumber()Returns whether this node is a number.final StringtoString()Returns a string representation of this record class.value()Returns the value of thevaluerecord component.
-
Constructor Details
-
NumberNode
Creates an instance of aNumberNoderecord class.- Parameters:
value- the value for thevaluerecord component
-
-
Method Details
-
isNumber
-
asString
-
asInt
-
asLong
-
asDouble
-
asBigDecimal
Description copied from interface:JsonNodeReturns this node's value as a BigDecimal. 返回此节点的值作为 BigDecimal。- Specified by:
asBigDecimalin interfaceJsonNode- Returns:
- the BigDecimal value - BigDecimal 值
-
asBigInteger
Description copied from interface:JsonNodeReturns this node's value as a BigInteger. 返回此节点的值作为 BigInteger。- Specified by:
asBigIntegerin interfaceJsonNode- Returns:
- the BigInteger value - BigInteger 值
-
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
-