Class BooleanUtils

    • Constructor Detail

      • BooleanUtils

        public BooleanUtils()
    • Method Detail

      • convertJsonNodeToBoolean

        public static boolean convertJsonNodeToBoolean​(com.fasterxml.jackson.databind.JsonNode node)
        See http://docs.jsonata.org/boolean-functions.html#booleanarg The convertJsonNodeToBoolean method converts the node passed in to a boolean based on the casting semantics defined by JSONata.

        $boolean(arg)

        Casts the argument to a Boolean using the following rules
        Argument typeResult
        Booleanunchanged
        string: emptyfalse
        string: non-emptytrue
        number: 0false
        number: non-zerotrue
        nullfalse
        array: emptyfalse
        array: contains a member that casts to truetrue
        array: all members cast to falsefalse
        object: emptyfalse
        object: non-emptytrue
        function: (functions are not currently supported)false
        Parameters:
        node - The node to convert to a boolean
        Returns:
        boolean The converted value