-
Notifications
You must be signed in to change notification settings - Fork 1
Utility functions
Returns a list consisting of the distinct elements of a given vector, list, array or JSON array.
distinct(["say", "what", "you", "need", "to", "say"]) //result: ["say", "what", "you", "need", "to"]
Returns the value of an environment variable associated with the given key in the Operating System.
getEnv("TEMP")
Returns the value of system property associated with the given key.
getSystemProperty("os.name")
Returns 1 (true) if the given parameter is a number (or string representing a number) containing decimals.
isDecimal(10.333) //returns: 1.0
isDecimal(999.0) //returns: 0.0
isDecimal("10.3") //returns: 1.0
isDecimal("1.0") //returns: 0.0
Returns 1 (true) if the given parameter is either a null object or an empty String, JSON or Collection.
If a given string can be parsed as JSON object or array, it will be first converted into JSON, then its structure will be evaluated for emptiness.
isEmpty("") //returns: 1.0
isEmpty("{}") //returns: 1.0
isEmpty("[]") //returns: 1.0
Returns 1 (true) if the given parameter is a number (or string representing a number) is a whole number (which lacks decimals).
isInteger(10.0) //returns: 1.0
isInteger(9.90) //returns: 0.0
isInteger("1.0") //returns: 1.0
isInteger("0.3") //returns: 0.0
Returns the content of a text file in the file system.
readFile("/tmp/data.json")
Returns the Java type associated with the given variable
typeOf("text") //result: "java.lang.String"
Note: Also achievable using the alias
class
.