Class BooleanUtils

java.lang.Object
com.api.jsonata4java.expressions.utils.BooleanUtils
All Implemented Interfaces:
Serializable

public class BooleanUtils extends Object implements Serializable
See Also:
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    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.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • BooleanUtils

      public BooleanUtils()
  • Method Details

    • 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