Interface ValueNode

All Superinterfaces:
Node
All Known Subinterfaces:
NumberNode
All Known Implementing Classes:
BigDecimalNode, BigIntegerNode, BooleanNode, DoubleNode, FloatNode, IntNode, LongNode, TextNode

public sealed interface ValueNode extends Node permits NumberNode, TextNode, BooleanNode
ValueNode
Version:
0.0.1
Author:
scx567888
  • Method Summary

    Modifier and Type
    Method
    Description
    转换为 BigDecimal
    转换为 BigInteger (不保证精度, 可能会发生截断)
    boolean
    转换为 boolean
    double
    转换为 double (不保证精度, 可能会发生截断)
    float
    转换为 float (不保证精度, 可能会发生截断)
    int
    转换为 int (不保证精度, 可能会发生截断)
    long
    转换为 long (不保证精度, 可能会发生截断)
    转换为 String
     

    Methods inherited from interface cool.scx.object.node.Node

    isNull
  • Method Details

    • asInt

      int asInt() throws NumberFormatException
      转换为 int (不保证精度, 可能会发生截断)
      Returns:
      int
      Throws:
      NumberFormatException - 数字格式不正确 (一般出现在 TextNode 中)
    • asLong

      long asLong() throws NumberFormatException
      转换为 long (不保证精度, 可能会发生截断)
      Returns:
      long
      Throws:
      NumberFormatException - 数字格式不正确 (一般出现在 TextNode 中)
    • asFloat

      float asFloat() throws NumberFormatException
      转换为 float (不保证精度, 可能会发生截断)
      Returns:
      float
      Throws:
      NumberFormatException - 数字格式不正确 (一般出现在 TextNode 中)
    • asDouble

      double asDouble() throws NumberFormatException
      转换为 double (不保证精度, 可能会发生截断)
      Returns:
      double
      Throws:
      NumberFormatException - 数字格式不正确 (一般出现在 TextNode 中)
    • asBigInteger

      BigInteger asBigInteger() throws NumberFormatException
      转换为 BigInteger (不保证精度, 可能会发生截断)
      Returns:
      BigInteger
      Throws:
      NumberFormatException - 数字格式不正确 (一般出现在 TextNode 中)
    • asBigDecimal

      BigDecimal asBigDecimal() throws NumberFormatException
      转换为 BigDecimal
      Returns:
      BigDecimal
      Throws:
      NumberFormatException - 数字格式不正确 (一般出现在 TextNode 中)
    • asText

      String asText()
      转换为 String
      Returns:
      String
    • asBoolean

      boolean asBoolean()

      转换为 boolean

      对于 数值类型 value != 0 对于 文本类型 "true".equalsIgnoreCase(s)

      Returns:
      boolean
    • deepCopy

      ValueNode deepCopy()
      Specified by:
      deepCopy in interface Node