Class NumberUtils

    • Constructor Detail

      • NumberUtils

        public NumberUtils()
    • Method Detail

      • convertNumberToValueNode

        public static final com.fasterxml.jackson.databind.node.ValueNode convertNumberToValueNode​(String number)
        The convertNumberToValueNode method converts the string passed in to a suitable subclass of ValueNode depending on whether it is an integer or decimal. For consistency with the JavaScript implementation of JSONata, we limit the size of the numbers that we handle to be within the range Double.MAX_VALUE and -Double.MAX_VALUE. If we did not do this we would need to implement a lot of extra code to handle BigInteger and BigDecimal.
        Parameters:
        number - The string representation of the number to convert
        Returns:
        ValueNode The ValueNode representation of the number contained in the input string
        Throws:
        EvaluateRuntimeException - If the number represented by the string is outside of the valid range or if the string does not contain a valid number.
      • convertToNumber

        public static com.fasterxml.jackson.databind.node.ValueNode convertToNumber​(String number)
        Attempts to convert a String based number representation using prefixes like 0x (hex), 0o (octal), 0b (binary)
        Parameters:
        number -
        Returns: