Expression Language

Contents

Overview

The Data Pipeline Expression Language (DPEL) is similar to that found in the Java language. It contains a few additions that make it easier to read for developers and non-developers alike.

The DPEL engine is used by several endpoints to parse and evaluate expressions at runtime. This allows expressions to be treated as configuration instead of being baked into the application. DPEL expressions can be used to set calculated fields, filter records, and generate XML (XmlElement's when(), element(), and attribute() methods all accept dynamic expressions).

The DPEL engine can also be used apart from Data Pipeline as long as you don't mind working with internal classes that may change in the future (see com.northconcepts.datapipeline.internal.parser.Parser.parseExpression(String)).

 

Literals

Type Description Example
String Single or double quoted Java String "abcd"
'abcd'
Integer Java long 123
Decimal Java double 123.0
Date / Time date 'yyyy-MM-dd'
time 'HH:mm'
timestamp 'yyyy-MM-dd HH:mm'
date '2010-04-22'
time '01:54'
timestamp '2010-04-22 01:54'
Interval

A measure of time.


<integer> millisecond(s) | second(s) | minute(s) | hour(s) | day(s) | week(s) | month(s) | year(s)

1 millisecond
2 milliseconds
base + 2 weeks
date '2010-04-22' + 5 days
date '2010-04-22' - start > 2 months
Boolean Java boolean: true, false, yes, or no completed == false
started == yes
Null Java null null

Variables

Type Description Example
Simple Case-sensitive identifier, beginning with a letter or underscore followed by zero or more letters, numbers, underscores, and periods. invoiceDate
invoice_date
Explicit A simple variable or variable containing spaces surrounded by ${ and }. ${invoiceDate}
${Invoice Date}
Positional A variable defined by position or context. Currently unused. ?

Arithmetic Operators

Type Description Example
Unary Plus   +a
Unary Minus   -a
-(a + b)
Exponent base ** exponent a ** b
2 ** 4
Multiplication   33 * 2
Divide   100 / 5
Remainder   78 % 5
78 mod 5
Addition Numeric addition or string concatenation 4 + 3
"abc" + 'def'
Subtraction   25.7 - 95.42

Relational Operators

Type Description Example
Equals = or == 1 = 1
1 == 1
true == yes
Not Equals != or <> a != b
a <> b
Greater > a > b
Greater or Equal >= a >= b
Less < a < b
Less or Equal <= a <= b

Logical Operators

Type Description Example
And and or && a && b
a and b
Or or or || a || b
a or b
Xor xor or ^ a ^ b
a xor b
Not not or ! !(a > 7)
not (a > 7)

Method Calls

The expression language supports calls to user-defined, static Java methods. Methods can be called either using their fully-qualified Java name or by an alias. See the add my own function example for a demo that registers and calls a function alias.




Examples

The following examples all use the built-in expression language.




Built-in Functions by Category

Conversion

  1. bytesToHex(byte[] bytes)Converts an array of bytes to a hexadecimal string.
  2. columnNameToInt(String columnName)Converts a string column name to an int. (e.g., column A = 0, column CW = 100, column AB = 27)
  3. dayOfMonth(Date date)Returns a number representing the day of the month (1–31) of the input date or null if the specified date is null.
  4. dayOfWeek(Date date)Returns a number representing the day of the week (0–6, Sunday is 0) of the input date or null if the specified date is null.
  5. dayOfYear(Date date)Returns a number representing the day of the year (1–366) of the input date or null if the specified date is null.
  6. formatDate(Date date, String pattern)Converts a java.util.Date to a string using the specified format pattern.
  7. formatDouble(Double number, String pattern)Converts a Double to a string using the specified format pattern.
  8. formatLong(Long number, String pattern)Converts a Long to a string using the specified format pattern.
  9. hour(Date date)Returns a number representing the hour of the day of the input date or null if the specified date is null.
  10. intToColumnName(int column)Converts an int to a string column name. Similar to spreadsheet column names. (e.g., column 27 = AB, column 100 = CW, column 0 = A)
  11. minute(Date date)Returns a number representing the minute within the hour of the input date or null if the specified date is null.
  12. month(Date date)Returns the date's month (1-12) or null if the specified date is null.
  13. parseBigDecimal(String s)Returns a BigDecimal initialized to the value of the specified string.
  14. parseBigInteger(String s)Returns a BigInteger initialized to the value of the specified string.
  15. parseBoolean(String s)Returns a boolean initialized to the value of the specified string.
  16. parseDate(String value, String pattern)Converts a string to a java.util.Date using the specified pattern.
  17. parseDouble(String s)Returns a double initialized to the value of the specified string.
  18. parseDouble(String number, String pattern)Converts a string to a double using the specified format pattern.
  19. parseInt(String s)Returns an int initialized to the value of the specified string.
  20. parseLong(String s)Returns a long initialized to the value of the specified string.
  21. parseLong(String number, String pattern)Converts a string to a long using the specified format pattern.
  22. second(Date date)Returns a number representing the second within the minute of the input date or null if the specified date is null.
  23. toBigDecimal(Object value)Converts value to a BigDecimal. This method accepts numbers, objects, and nulls (not just strings). It also trims strings if parsing is needed.
  24. toBigInteger(Object value)Converts value to a BigInteger. This method accepts numbers, objects, and nulls (not just strings). It also trims strings if parsing is needed.
  25. toDate(Date value)Converts value to a java.sql.Date.
  26. toDatetime(Date value)Converts value to a java.util.Date.
  27. toDouble(Object value)Converts value to a Double. This method accepts numbers, objects, and nulls (not just strings). It also trims strings if parsing is needed.
  28. toInt(Object value)Converts value to an Integer. This method accepts numbers, objects, and nulls (not just strings). It also trims strings if parsing is needed.
  29. toLong(Object value)Converts value to a Long. This method accepts numbers, objects, and nulls (not just strings). It also trims strings if parsing is needed.
  30. toTime(Date value)Converts value to a java.sql.Time.
  31. weekOfYear(Date date)Returns a number representing the week of the year (0–53) of the input date or null if the specified date is null.
  32. year(Date date)Returns the date's year or null if the specified date is null.

Datetime

  1. dayOfMonth(Date date)Returns a number representing the day of the month (1–31) of the input date or null if the specified date is null.
  2. dayOfWeek(Date date)Returns a number representing the day of the week (0–6, Sunday is 0) of the input date or null if the specified date is null.
  3. dayOfYear(Date date)Returns a number representing the day of the year (1–366) of the input date or null if the specified date is null.
  4. formatDate(Date date, String pattern)Converts a java.util.Date to a string using the specified format pattern.
  5. hour(Date date)Returns a number representing the hour of the day of the input date or null if the specified date is null.
  6. minute(Date date)Returns a number representing the minute within the hour of the input date or null if the specified date is null.
  7. month(Date date)Returns the date's month (1-12) or null if the specified date is null.
  8. now()Returns the current date-time.
  9. parseDate(String value, String pattern)Converts a string to a java.util.Date using the specified pattern.
  10. second(Date date)Returns a number representing the second within the minute of the input date or null if the specified date is null.
  11. toDate(Date value)Converts value to a java.sql.Date.
  12. toDatetime(Date value)Converts value to a java.util.Date.
  13. toTime(Date value)Converts value to a java.sql.Time.
  14. weekOfYear(Date date)Returns a number representing the week of the year (0–53) of the input date or null if the specified date is null.
  15. year(Date date)Returns the date's year or null if the specified date is null.

Logical

  1. coalesce(Object ... expression)Returns the first non-null expression or null if all expressions are null.
  2. compare(Object o1, Object o2)Compares two Objects. Returns 0 if both objects are equal, -1 if the first object is null, 1 if the second object in null.
  3. compare(String s1, String s2, boolean caseSensitive)Compares two string if they are equal. If caseSensitive is true, it matches the exact case. A value of 0 is returned if the strings are equal, -1 if the first string is null, 1 if the second string is null.
  4. decode(Object expression, Object search1, Object result1, Object ... searchResultDefault)Returns result1 if expression equals search1. Otherwise expression is matched against searchResultDefault and the result is the next Object in the array (i.e., the array are search pairs of search and result objects).
  5. equals(Object expression1, Object expression2)Returns true if both Objects are equal.
  6. iif(boolean booleanExpression, Object trueResult, Object falseResult)Returns trueResult if booleanExpression is true, otherwise returns falseResult.
  7. isOneOf(int actual, int ... expected)Returns true if actual equals one of the integers in expected.
  8. isOneOf(Object actual, Object ... expected)Returns true if actual equals one of the objects in expected.
  9. matches(String s1, String s2, boolean caseSensitive, boolean allowEmpty)Returns true if both strings match. If caseSensitive is true, it will match the exact case. If allowEmpty is true, it will allow matching with an empty string.
  10. matches(String s1, String s2, boolean caseSensitive)Returns true if both strings match. If caseSensitive is true, it will match the exact case.
  11. matches(String s1, String s2)Returns true if both strings match.
  12. nullif(Object expression1, Object expression2)Returns null if the two expressions are equal, otherwise returns expression1.
  13. parseBoolean(String s)Returns a boolean initialized to the value of the specified string.

Math

  1. abs(int a)Returns the absolute value of a number.
  2. abs(long a)Returns the absolute value of a number.
  3. abs(double a)Returns the absolute value of a number.
  4. abs(BigInteger a)Returns the absolute value of a number.
  5. abs(BigDecimal a)Returns the absolute value of a number.
  6. acos(double a)Returns the arc cosine of a double.
  7. asin(double a)Returns the arc sine of a double.
  8. atan(double a)Returns the arc tangent of a double.
  9. cbrt(double a)Returns the cube root of a double value.
  10. ceil(double a)Returns the smallest value that is greater or equal to the parameter value.
  11. cos(double a)Returns the cosine of a double.
  12. cosh(double a)Returns the hyberbolic cosine value of the parameter.
  13. floor(double a)Returns the largest value that is lesser or equal to the parameter value.
  14. hypot(double a, double b)Returns the sqrt(a2 + b2) value of the parameters.
  15. log(double a)Returns the natural logarithm of a double value.
  16. log10(double a)Returns the base 10 logarithm of a double value.
  17. max(int a, int ... b)Returns the largest number of a set of numbers.
  18. max(long a, long ... b)Returns the largest number of a set of numbers.
  19. max(double a, double ... b)Returns the largest number of a set of numbers.
  20. max(BigDecimal a, BigDecimal ... b)Returns the largest number of a set of numbers.
  21. max(BigInteger a, BigInteger ... b)Returns the largest number of a set of numbers.
  22. min(int a, int ... b)Returns the smallest number of a set of numbers.
  23. min(long a, long ... b)Returns the smallest number of a set of numbers.
  24. min(double a, double ... b)Returns the smallest number from a set of numbers.
  25. min(BigDecimal a, BigDecimal ... b)Returns the smallest number from a set of numbers.
  26. min(BigInteger a, BigInteger ... b)Returns the smallest number from a set of numbers.
  27. random()Returns a pseudorandomly chosen value between 0.0,and 1.0
  28. rint(double a)Returns a value that is equal to a mathematical integer closest in value to the parameter.
  29. round(double a)Returns a long value closest to the parameter
  30. signum(int a)Returns the signum function value of the parameter.
  31. signum(long a)Returns the signum function value of the parameter.
  32. signum(double a)Returns the signum function value of the parameter.
  33. signum(BigInteger a)Returns the signum function value of the parameter.
  34. signum(BigDecimal a)Returns the signum function value of the parameter.
  35. sin(double a)Returns the sine of a double.
  36. sinh(double a)Returns the hyberbolic sine value of the parameter.
  37. sqrt(double a)Returns the square root of a double value.
  38. tan(double a)Returns the tangent of a double.
  39. tanh(double a)Returns the hyberbolic tangent value of the parameter.
  40. toDegrees(double a)Returns the approximate degrees equivalent value of an angle measured in radians.
  41. toRadians(double a)Returns the approximate radians equivalent value of an angle measured in degrees.

Numeric

  1. columnNameToInt(String columnName)Converts a string column name to an int. (e.g., column A = 0, column CW = 100, column AB = 27)
  2. formatDouble(Double number, String pattern)Converts a Double to a string using the specified format pattern.
  3. formatLong(Long number, String pattern)Converts a Long to a string using the specified format pattern.
  4. intToColumnName(int column)Converts an int to a string column name. Similar to spreadsheet column names. (e.g., column 27 = AB, column 100 = CW, column 0 = A)
  5. parseBigDecimal(String s)Returns a BigDecimal initialized to the value of the specified string.
  6. parseBigInteger(String s)Returns a BigInteger initialized to the value of the specified string.
  7. parseDouble(String s)Returns a double initialized to the value of the specified string.
  8. parseDouble(String number, String pattern)Converts a string to a double using the specified format pattern.
  9. parseInt(String s)Returns an int initialized to the value of the specified string.
  10. parseLong(String s)Returns a long initialized to the value of the specified string.
  11. parseLong(String number, String pattern)Converts a string to a long using the specified format pattern.
  12. toBigDecimal(Object value)Converts value to a BigDecimal. This method accepts numbers, objects, and nulls (not just strings). It also trims strings if parsing is needed.
  13. toBigInteger(Object value)Converts value to a BigInteger. This method accepts numbers, objects, and nulls (not just strings). It also trims strings if parsing is needed.
  14. toDouble(Object value)Converts value to a Double. This method accepts numbers, objects, and nulls (not just strings). It also trims strings if parsing is needed.
  15. toInt(Object value)Converts value to an Integer. This method accepts numbers, objects, and nulls (not just strings). It also trims strings if parsing is needed.
  16. toLong(Object value)Converts value to a Long. This method accepts numbers, objects, and nulls (not just strings). It also trims strings if parsing is needed.

Security

  1. sha256(Object ... values)Applies the SHA-256 message digest algorithm to values and returns it as a string.
  2. sha512(Object ... values)Applies the SHA-512 message digest algorithm to values and returns it as a string.

String

  1. arrayToString(Object[] array, String separator)Convert an array of Objects to a String separated by the separator.
  2. arrayToString(int[] array, String separator)Convert an int array to a String separated by the separator.
  3. arrayToString(long[] array, String separator)Convert a long array to a String separated by the separator.
  4. arrayToString(double[] array, String separator)Convert a double array to a String separated by the separator.
  5. arrayToString(List array, String separator)Convert a List<?> to a String separated by the separator.
  6. bytesToHex(byte[] bytes)Converts an array of bytes to a hexadecimal string.
  7. columnNameToInt(String columnName)Converts a string column name to an int. (e.g., column A = 0, column CW = 100, column AB = 27)
  8. compare(String s1, String s2, boolean caseSensitive)Compares two string if they are equal. If caseSensitive is true, it matches the exact case. A value of 0 is returned if the strings are equal, -1 if the first string is null, 1 if the second string is null.
  9. contains(String string, String substring)Returns true if the string contains the substring. It will match the exact case.
  10. contains(String string, String substring, boolean caseSensitive)Returns true if the string contains the substring. If caseSensitive is true, it will match the exact case.
  11. contains(String[] elements, String element, boolean caseSensitive)Returns true if the string element is contained in the array of string elements. If caseSensitive is true, it will match the exact case.
  12. emptyToNull(String s)Returns null if the string is empty. Otherwise, the same string is returned.
  13. endsWith(String string, String substring, boolean caseSensitive)Returns true if the string ends with the substring. If caseSensitive is true, it will match the exact case.
  14. endsWith(CharSequence string, CharSequence substring)Returns true if the string ends with the substring.
  15. formatDate(Date date, String pattern)Converts a java.util.Date to a string using the specified format pattern.
  16. formatDouble(Double number, String pattern)Converts a Double to a string using the specified format pattern.
  17. formatLong(Long number, String pattern)Converts a Long to a string using the specified format pattern.
  18. getCharacterCount(String string, char searchChar)Returns the number of searchChars contained in string or zero (0).
  19. getRandomString(int length)Returns a random string with the specified length.
  20. indexOf(String string, String substring, boolean caseSensitive)Returns the position of the substring within the string or -1. If caseSensitive is true, it will match the exact case.
  21. intToColumnName(int column)Converts an int to a string column name. Similar to spreadsheet column names. (e.g., column 27 = AB, column 100 = CW, column 0 = A)
  22. isEmpty(String s)Return true if the string is empty, null or all whitespaces.
  23. isNotEmpty(String s)Return true if the string is not empty or is not null.
  24. join(String separator, String ... elements)Returns a String composed of the elements joined by the separator.
  25. left(String string, int length)Returns the substring of string starting from the left until the specified length.
  26. length(Object value)Returns the length of value.
  27. matches(String s1, String s2, boolean caseSensitive, boolean allowEmpty)Returns true if both strings match. If caseSensitive is true, it will match the exact case. If allowEmpty is true, it will allow matching with an empty string.
  28. matches(String s1, String s2, boolean caseSensitive)Returns true if both strings match. If caseSensitive is true, it will match the exact case.
  29. matches(String s1, String s2)Returns true if both strings match.
  30. matchesRegex(String string, String regex)Returns true if the provided string matches the given regular expression.
  31. padLeft(String string, int length, char padChar)Pads the number of characters specified on the left of the string, length is the resulting size of the string with padding.
  32. padRight(String string, int length, char padChar)Pads the number of characters specified on the right of the string, length is the resulting size of the string with padding.
  33. parseBigDecimal(String s)Returns a BigDecimal initialized to the value of the specified string.
  34. parseBigInteger(String s)Returns a BigInteger initialized to the value of the specified string.
  35. parseBoolean(String s)Returns a boolean initialized to the value of the specified string.
  36. parseDate(String value, String pattern)Converts a string to a java.util.Date using the specified pattern.
  37. parseDouble(String s)Returns a double initialized to the value of the specified string.
  38. parseDouble(String number, String pattern)Converts a string to a double using the specified format pattern.
  39. parseInt(String s)Returns an int initialized to the value of the specified string.
  40. parseLong(String s)Returns a long initialized to the value of the specified string.
  41. parseLong(String number, String pattern)Converts a string to a long using the specified format pattern.
  42. repeat(String string, int count)Creates a new string out of the string provided, appended count times.
  43. reverse(String a)Returns the reverse sequence of the input String.
  44. right(String string, int length)Returns the substring of string starting from the right until the specified length.
  45. split(String string, String regex, int limit)Returns an array of String split around the given regular expression.
  46. split(String string, String regex)Returns an array of String split around the given regular expression.
  47. startsWith(String string, String substring, boolean caseSensitive)Returns true if the string starts with substring. If caseSensitive is true, it will match the exact case.
  48. startsWith(CharSequence string, CharSequence substring)Returns true if the string starts with substring.
  49. startsWith(CharSequence string, CharSequence substring, int offset)Returns true if the string starts with substring. If offset is set, it will start matching the substring at that point in the string.
  50. substring(String string, int beginIndex, int endIndex)Returns the substring of string starting from the beginIndex until one before the endIndex. An empty is returned if either index is greater than the length of the string.
  51. toLowerCase(Object value)Converts all the characters in value to lowercase.
  52. toUpperCase(Object value)Converts all the characters in value to uppercase.
  53. trimLeft(String string)Removes all leading whitespace.
  54. trimLeft(String string, char padChar)Removes all leading characters specified. If padChar is not specified, whitespace is removed.
  55. trimRight(String string)Removes all trailing whitespace.
  56. trimRight(String string, char padChar)Removes all trailing characters specified. If padChar is not specified, whitespace is removed.



Built-in Functions Index

abs(int a) Returns the absolute value of a number.
abs(long a) Returns the absolute value of a number.
abs(double a) Returns the absolute value of a number.
abs(BigInteger a) Returns the absolute value of a number.
abs(BigDecimal a) Returns the absolute value of a number.
acos(double a) Returns the arc cosine of a double.
arrayToString(Object[] array, String separator) Convert an array of Objects to a String separated by the separator.
arrayToString(int[] array, String separator) Convert an int array to a String separated by the separator.
arrayToString(long[] array, String separator) Convert a long array to a String separated by the separator.
arrayToString(double[] array, String separator) Convert a double array to a String separated by the separator.
arrayToString(List array, String separator) Convert a List<?> to a String separated by the separator.
asin(double a) Returns the arc sine of a double.
atan(double a) Returns the arc tangent of a double.
bytesToHex(byte[] bytes) Converts an array of bytes to a hexadecimal string.
cbrt(double a) Returns the cube root of a double value.
ceil(double a) Returns the smallest value that is greater or equal to the parameter value.
coalesce(Object ... expression) Returns the first non-null expression or null if all expressions are null.
columnNameToInt(String columnName) Converts a string column name to an int. (e.g., column A = 0, column CW = 100, column AB = 27)
compare(Object o1, Object o2) Compares two Objects. Returns 0 if both objects are equal, -1 if the first object is null, 1 if the second object in null.
compare(String s1, String s2, boolean caseSensitive) Compares two string if they are equal. If caseSensitive is true, it matches the exact case. A value of 0 is returned if the strings are equal, -1 if the first string is null, 1 if the second string is null.
contains(String string, String substring) Returns true if the string contains the substring. It will match the exact case.
contains(String string, String substring, boolean caseSensitive) Returns true if the string contains the substring. If caseSensitive is true, it will match the exact case.
contains(String[] elements, String element, boolean caseSensitive) Returns true if the string element is contained in the array of string elements. If caseSensitive is true, it will match the exact case.
cos(double a) Returns the cosine of a double.
cosh(double a) Returns the hyberbolic cosine value of the parameter.
dayOfMonth(Date date) Returns a number representing the day of the month (1–31) of the input date or null if the specified date is null.
dayOfWeek(Date date) Returns a number representing the day of the week (0–6, Sunday is 0) of the input date or null if the specified date is null.
dayOfYear(Date date) Returns a number representing the day of the year (1–366) of the input date or null if the specified date is null.
decode(Object expression, Object search1, Object result1, Object ... searchResultDefault) Returns result1 if expression equals search1. Otherwise expression is matched against searchResultDefault and the result is the next Object in the array (i.e., the array are search pairs of search and result objects).
emptyToNull(String s) Returns null if the string is empty. Otherwise, the same string is returned.
endsWith(String string, String substring, boolean caseSensitive) Returns true if the string ends with the substring. If caseSensitive is true, it will match the exact case.
endsWith(CharSequence string, CharSequence substring) Returns true if the string ends with the substring.
equals(Object expression1, Object expression2) Returns true if both Objects are equal.
floor(double a) Returns the largest value that is lesser or equal to the parameter value.
formatDate(Date date, String pattern) Converts a java.util.Date to a string using the specified format pattern.
formatDouble(Double number, String pattern) Converts a Double to a string using the specified format pattern.
formatLong(Long number, String pattern) Converts a Long to a string using the specified format pattern.
getCharacterCount(String string, char searchChar) Returns the number of searchChars contained in string or zero (0).
getRandomString(int length) Returns a random string with the specified length.
hour(Date date) Returns a number representing the hour of the day of the input date or null if the specified date is null.
hypot(double a, double b) Returns the sqrt(a2 + b2) value of the parameters.
iif(boolean booleanExpression, Object trueResult, Object falseResult) Returns trueResult if booleanExpression is true, otherwise returns falseResult.
indexOf(String string, String substring, boolean caseSensitive) Returns the position of the substring within the string or -1. If caseSensitive is true, it will match the exact case.
intToColumnName(int column) Converts an int to a string column name. Similar to spreadsheet column names. (e.g., column 27 = AB, column 100 = CW, column 0 = A)
isEmpty(String s) Return true if the string is empty, null or all whitespaces.
isNotEmpty(String s) Return true if the string is not empty or is not null.
isOneOf(int actual, int ... expected) Returns true if actual equals one of the integers in expected.
isOneOf(Object actual, Object ... expected) Returns true if actual equals one of the objects in expected.
join(String separator, String ... elements) Returns a String composed of the elements joined by the separator.
left(String string, int length) Returns the substring of string starting from the left until the specified length.
length(Object value) Returns the length of value.
log(double a) Returns the natural logarithm of a double value.
log10(double a) Returns the base 10 logarithm of a double value.
matches(String s1, String s2, boolean caseSensitive, boolean allowEmpty) Returns true if both strings match. If caseSensitive is true, it will match the exact case. If allowEmpty is true, it will allow matching with an empty string.
matches(String s1, String s2, boolean caseSensitive) Returns true if both strings match. If caseSensitive is true, it will match the exact case.
matches(String s1, String s2) Returns true if both strings match.
matchesRegex(String string, String regex) Returns true if the provided string matches the given regular expression.
max(int a, int ... b) Returns the largest number of a set of numbers.
max(long a, long ... b) Returns the largest number of a set of numbers.
max(double a, double ... b) Returns the largest number of a set of numbers.
max(BigDecimal a, BigDecimal ... b) Returns the largest number of a set of numbers.
max(BigInteger a, BigInteger ... b) Returns the largest number of a set of numbers.
min(int a, int ... b) Returns the smallest number of a set of numbers.
min(long a, long ... b) Returns the smallest number of a set of numbers.
min(double a, double ... b) Returns the smallest number from a set of numbers.
min(BigDecimal a, BigDecimal ... b) Returns the smallest number from a set of numbers.
min(BigInteger a, BigInteger ... b) Returns the smallest number from a set of numbers.
minute(Date date) Returns a number representing the minute within the hour of the input date or null if the specified date is null.
month(Date date) Returns the date's month (1-12) or null if the specified date is null.
now() Returns the current date-time.
nullif(Object expression1, Object expression2) Returns null if the two expressions are equal, otherwise returns expression1.
padLeft(String string, int length, char padChar) Pads the number of characters specified on the left of the string, length is the resulting size of the string with padding.
padRight(String string, int length, char padChar) Pads the number of characters specified on the right of the string, length is the resulting size of the string with padding.
parseBigDecimal(String s) Returns a BigDecimal initialized to the value of the specified string.
parseBigInteger(String s) Returns a BigInteger initialized to the value of the specified string.
parseBoolean(String s) Returns a boolean initialized to the value of the specified string.
parseDate(String value, String pattern) Converts a string to a java.util.Date using the specified pattern.
parseDouble(String s) Returns a double initialized to the value of the specified string.
parseDouble(String number, String pattern) Converts a string to a double using the specified format pattern.
parseInt(String s) Returns an int initialized to the value of the specified string.
parseLong(String s) Returns a long initialized to the value of the specified string.
parseLong(String number, String pattern) Converts a string to a long using the specified format pattern.
random() Returns a pseudorandomly chosen value between 0.0,and 1.0
repeat(String string, int count) Creates a new string out of the string provided, appended count times.
reverse(String a) Returns the reverse sequence of the input String.
right(String string, int length) Returns the substring of string starting from the right until the specified length.
rint(double a) Returns a value that is equal to a mathematical integer closest in value to the parameter.
round(double a) Returns a long value closest to the parameter
second(Date date) Returns a number representing the second within the minute of the input date or null if the specified date is null.
sha256(Object ... values) Applies the SHA-256 message digest algorithm to values and returns it as a string.
sha512(Object ... values) Applies the SHA-512 message digest algorithm to values and returns it as a string.
signum(int a) Returns the signum function value of the parameter.
signum(long a) Returns the signum function value of the parameter.
signum(double a) Returns the signum function value of the parameter.
signum(BigInteger a) Returns the signum function value of the parameter.
signum(BigDecimal a) Returns the signum function value of the parameter.
sin(double a) Returns the sine of a double.
sinh(double a) Returns the hyberbolic sine value of the parameter.
split(String string, String regex, int limit) Returns an array of String split around the given regular expression.
split(String string, String regex) Returns an array of String split around the given regular expression.
sqrt(double a) Returns the square root of a double value.
startsWith(String string, String substring, boolean caseSensitive) Returns true if the string starts with substring. If caseSensitive is true, it will match the exact case.
startsWith(CharSequence string, CharSequence substring) Returns true if the string starts with substring.
startsWith(CharSequence string, CharSequence substring, int offset) Returns true if the string starts with substring. If offset is set, it will start matching the substring at that point in the string.
substring(String string, int beginIndex, int endIndex) Returns the substring of string starting from the beginIndex until one before the endIndex. An empty is returned if either index is greater than the length of the string.
tan(double a) Returns the tangent of a double.
tanh(double a) Returns the hyberbolic tangent value of the parameter.
toBigDecimal(Object value) Converts value to a BigDecimal. This method accepts numbers, objects, and nulls (not just strings). It also trims strings if parsing is needed.
toBigInteger(Object value) Converts value to a BigInteger. This method accepts numbers, objects, and nulls (not just strings). It also trims strings if parsing is needed.
toDate(Date value) Converts value to a java.sql.Date.
toDatetime(Date value) Converts value to a java.util.Date.
toDegrees(double a) Returns the approximate degrees equivalent value of an angle measured in radians.
toDouble(Object value) Converts value to a Double. This method accepts numbers, objects, and nulls (not just strings). It also trims strings if parsing is needed.
toInt(Object value) Converts value to an Integer. This method accepts numbers, objects, and nulls (not just strings). It also trims strings if parsing is needed.
toLong(Object value) Converts value to a Long. This method accepts numbers, objects, and nulls (not just strings). It also trims strings if parsing is needed.
toLowerCase(Object value) Converts all the characters in value to lowercase.
toRadians(double a) Returns the approximate radians equivalent value of an angle measured in degrees.
toTime(Date value) Converts value to a java.sql.Time.
toUpperCase(Object value) Converts all the characters in value to uppercase.
trimLeft(String string) Removes all leading whitespace.
trimLeft(String string, char padChar) Removes all leading characters specified. If padChar is not specified, whitespace is removed.
trimRight(String string) Removes all trailing whitespace.
trimRight(String string, char padChar) Removes all trailing characters specified. If padChar is not specified, whitespace is removed.
weekOfYear(Date date) Returns a number representing the week of the year (0–53) of the input date or null if the specified date is null.
year(Date date) Returns the date's year or null if the specified date is null.



Built-in Functions

Returns the absolute value of a number.
Parameters:
a - the int value whose absolute value is to be determined
Returns:
int
Returns the absolute value of a number.
Parameters:
a - the long value whose absolute value is to be determined
Returns:
long
Returns the absolute value of a number.
Parameters:
a - the double value whose absolute value is to be determined
Returns:
double
Returns the absolute value of a number.
Parameters:
a - the BigInteger value whose absolute value is to be determined
Returns:
java.math.BigInteger
Returns the absolute value of a number.
Parameters:
a - the BigDecimal value whose absolute value is to be determined
Returns:
java.math.BigDecimal
Returns the arc cosine of a double.
Returns:
double
Convert an array of Objects to a String separated by the separator.
Parameters:
array - Object array
separator - the separator for the Objects
Returns:
java.lang.String
Convert an int array to a String separated by the separator.
Parameters:
array - int array
separator - the separator for the ints
Returns:
java.lang.String
Convert a long array to a String separated by the separator.
Parameters:
array - long array
separator - the separator for the longs
Returns:
java.lang.String
Convert a double array to a String separated by the separator.
Parameters:
array - double array
separator - the separator for the doubles
Returns:
java.lang.String
Convert a List<?> to a String separated by the separator.
Parameters:
array - a List<?>
separator - the separator for the List<?>
Returns:
java.lang.String
Returns the arc sine of a double.
Returns:
double
Returns the arc tangent of a double.
Returns:
double
Converts an array of bytes to a hexadecimal string.
Parameters:
bytes - the array of bytes to convert
Returns:
java.lang.String
Returns the cube root of a double value.
Returns:
double
Returns the smallest value that is greater or equal to the parameter value.
Returns:
double
Returns the first non-null expression or null if all expressions are null.
Parameters:
expression - an array of Objects
Returns:
java.lang.Object
Converts a string column name to an int. (e.g., column A = 0, column CW = 100, column AB = 27)
Parameters:
columnName - the string to convert
Returns:
int
Compares two Objects. Returns 0 if both objects are equal, -1 if the first object is null, 1 if the second object in null.
Parameters:
o1 - the first Object
o2 - the second Object
Returns:
int
Compares two string if they are equal. If caseSensitive is true, it matches the exact case. A value of 0 is returned if the strings are equal, -1 if the first string is null, 1 if the second string is null.
Parameters:
s1 - the first string to compare to
s2 - the second string to compare to
caseSensitive - set to false to ignore case
Returns:
int
Returns true if the string contains the substring. It will match the exact case.
Parameters:
string - the string to be searched
substring - the string to search for
Returns:
boolean
Returns true if the string contains the substring. If caseSensitive is true, it will match the exact case.
Parameters:
string - the string to be searched
substring - the string to search for
caseSensitive - set to true to match exact case
Returns:
boolean
Returns true if the string element is contained in the array of string elements. If caseSensitive is true, it will match the exact case.
Parameters:
elements - array of strings to be searched
element - the string to search for
caseSensitive - set to true to match exact case
Returns:
boolean
Returns the cosine of a double.
Returns:
double
Returns the hyberbolic cosine value of the parameter.
Returns:
double
Returns a number representing the day of the month (1–31) of the input date or null if the specified date is null.
Returns:
java.lang.Integer
Returns a number representing the day of the week (0–6, Sunday is 0) of the input date or null if the specified date is null.
Returns:
java.lang.Integer
Returns a number representing the day of the year (1–366) of the input date or null if the specified date is null.
Returns:
java.lang.Integer
Returns result1 if expression equals search1. Otherwise expression is matched against searchResultDefault and the result is the next Object in the array (i.e., the array are search pairs of search and result objects).
Parameters:
expression - the Object to search for
search1 - the first Object to be matched with expression
result1 - returned when expression equals search1
searchResultDefault - an array of search pairs (search and result)
Returns:
java.lang.Object
Returns null if the string is empty. Otherwise, the same string is returned.
Parameters:
s - a string
Returns:
java.lang.String
Returns true if the string ends with the substring. If caseSensitive is true, it will match the exact case.
Parameters:
string - the string to be searched
substring - the string to search for
caseSensitive - set to true to match exact case
Returns:
boolean
Returns true if the string ends with the substring.
Parameters:
string - the CharSequence to be searched
substring - the CharSequence to search for
Returns:
boolean
Returns true if both Objects are equal.
Parameters:
expression1 - the first Object to compare
expression2 - the second Object to compare
Returns:
boolean
Returns the largest value that is lesser or equal to the parameter value.
Returns:
double
Converts a java.util.Date to a string using the specified format pattern.
Parameters:
date - the date to be formatted as a string.
pattern - the pattern describing the date and time format.
Returns:
java.lang.String
Converts a Double to a string using the specified format pattern.
Parameters:
number - the value to format
pattern - the pattern describing the number format.
Returns:
java.lang.String
Converts a Long to a string using the specified format pattern.
Parameters:
number - the value to format
pattern - the pattern describing the number format.
Returns:
java.lang.String
Returns the number of searchChars contained in string or zero (0).
Parameters:
string - the string to be searched
searchChar - the character to search for
Returns:
int
Returns a random string with the specified length.
Parameters:
length - the resulting length of the string
Returns:
java.lang.String
Returns a number representing the hour of the day of the input date or null if the specified date is null.
Returns:
java.lang.Integer
Returns the sqrt(a2 + b2) value of the parameters.
Returns:
double
Returns trueResult if booleanExpression is true, otherwise returns falseResult.
Parameters:
booleanExpression - the boolean expression
trueResult - the Object to return if the boolean expression is true
falseResult - the Object to return if the boolean expression is false
Returns:
java.lang.Object
Returns the position of the substring within the string or -1. If caseSensitive is true, it will match the exact case.
Parameters:
string - the string to be searched
substring - the string to search for
caseSensitive - set to true to match exact case
Returns:
int
Converts an int to a string column name. Similar to spreadsheet column names. (e.g., column 27 = AB, column 100 = CW, column 0 = A)
Parameters:
column - the number to convert
Returns:
java.lang.String
Return true if the string is empty, null or all whitespaces.
Parameters:
s - the string to be processed
Returns:
boolean
Return true if the string is not empty or is not null.
Parameters:
s - the string to be processed
Returns:
boolean
Returns true if actual equals one of the integers in expected.
Parameters:
actual - the int to compare
expected - the array of int to be compared with
Returns:
boolean
Returns true if actual equals one of the objects in expected.
Parameters:
actual - the Object to compare
expected - the array of Objects to be compared with
Returns:
java.lang.Object
Returns a String composed of the elements joined by the separator.
Returns:
java.lang.String
Returns the substring of string starting from the left until the specified length.
Parameters:
string - the string to be parsed
length - the number of characters to return
Returns:
java.lang.String
Returns the length of value.
Parameters:
value - the Object to be processed
Returns:
int
Returns the natural logarithm of a double value.
Returns:
double
Returns the base 10 logarithm of a double value.
Returns:
double
Returns true if both strings match. If caseSensitive is true, it will match the exact case. If allowEmpty is true, it will allow matching with an empty string.
Parameters:
s1 - the first string to match
s2 - the second string to match
caseSensitive - set to true to match exact case
allowEmpty - set to true to allow empty string matching
Returns:
boolean
Returns true if both strings match. If caseSensitive is true, it will match the exact case.
Parameters:
s1 - the first string to match
s2 - the second string to match
caseSensitive - set to true to match exact case
Returns:
boolean
Returns true if both strings match.
Parameters:
s1 - the first string to match
s2 - the second string to match
Returns:
boolean
Returns true if the provided string matches the given regular expression.
Returns:
boolean
Returns the largest number of a set of numbers.
Returns:
int
Returns the largest number of a set of numbers.
Returns:
long
Returns the largest number of a set of numbers.
Returns:
double
Returns the largest number of a set of numbers.
Returns:
java.math.BigDecimal
Returns the largest number of a set of numbers.
Returns:
java.math.BigInteger
Returns the smallest number of a set of numbers.
Returns:
int
Returns the smallest number of a set of numbers.
Returns:
long
Returns the smallest number from a set of numbers.
Returns:
double
Returns the smallest number from a set of numbers.
Returns:
java.math.BigDecimal
Returns the smallest number from a set of numbers.
Returns:
java.math.BigInteger
Returns a number representing the minute within the hour of the input date or null if the specified date is null.
Returns:
java.lang.Integer
Returns the date's month (1-12) or null if the specified date is null.
Returns:
java.lang.Integer
Returns the current date-time.
Returns:
java.util.Date
Returns null if the two expressions are equal, otherwise returns expression1.
Parameters:
expression1 - the first Object to compare
expression2 - the second Object to compare
Returns:
java.lang.Object
Pads the number of characters specified on the left of the string, length is the resulting size of the string with padding.
Parameters:
string - the string to be padded
length - the resulting size of the string with padding
padChar - the character to add/pad
Returns:
java.lang.String
Pads the number of characters specified on the right of the string, length is the resulting size of the string with padding.
Parameters:
string - the string to be padded
length - the resulting size of the string with padding
padChar - the character to add/pad
Returns:
java.lang.String
Returns a BigDecimal initialized to the value of the specified string.
Parameters:
s - the string to be parsed
Returns:
java.math.BigDecimal
Returns a BigInteger initialized to the value of the specified string.
Parameters:
s - the string to be parsed
Returns:
java.math.BigInteger
Returns a boolean initialized to the value of the specified string.
Parameters:
s - the string to be parsed
Returns:
boolean
Converts a string to a java.util.Date using the specified pattern.
Parameters:
value - the string to parse.
pattern - the pattern describing the date and time format.
Returns:
java.util.Date
Returns a double initialized to the value of the specified string.
Parameters:
s - the string to be parsed
Returns:
double
Converts a string to a double using the specified format pattern.
Parameters:
number - the value to parse.
pattern - the pattern describing the number format.
Returns:
double
Returns an int initialized to the value of the specified string.
Parameters:
s - the string to be parsed
Returns:
int
Returns a long initialized to the value of the specified string.
Parameters:
s - the string to be parsed
Returns:
long
Converts a string to a long using the specified format pattern.
Parameters:
number - the value to parse.
pattern - the pattern describing the number format.
Returns:
long
Returns a pseudorandomly chosen value between 0.0,and 1.0
Returns:
double
Creates a new string out of the string provided, appended count times.
Parameters:
string - the string to append
count - the number of times to append the string
Returns:
java.lang.String
Returns the reverse sequence of the input String.
Returns:
java.lang.String
Returns the substring of string starting from the right until the specified length.
Parameters:
string - the string to be parsed
length - the number of characters to return
Returns:
java.lang.String
Returns a value that is equal to a mathematical integer closest in value to the parameter.
Returns:
double
Returns a long value closest to the parameter
Returns:
long
Returns a number representing the second within the minute of the input date or null if the specified date is null.
Returns:
java.lang.Integer
Applies the SHA-256 message digest algorithm to values and returns it as a string.
Parameters:
values - the Object array to be hashed
Returns:
java.lang.String
Applies the SHA-512 message digest algorithm to values and returns it as a string.
Parameters:
values - the Object array to be hashed
Returns:
java.lang.String
Returns the signum function value of the parameter.
Returns:
int
Returns the signum function value of the parameter.
Returns:
long
Returns the signum function value of the parameter.
Returns:
double
Returns the signum function value of the parameter.
Returns:
java.lang.Integer
Returns the signum function value of the parameter.
Returns:
java.lang.Integer
Returns the sine of a double.
Returns:
double
Returns the hyberbolic sine value of the parameter.
Returns:
double
Returns an array of String split around the given regular expression.
Returns:
java.lang.String[]
Returns an array of String split around the given regular expression.
Returns:
java.lang.String[]
Returns the square root of a double value.
Returns:
double
Returns true if the string starts with substring. If caseSensitive is true, it will match the exact case.
Parameters:
string - the string to be searched
substring - the substring to search for
caseSensitive - set to true to match exact case
Returns:
boolean
Returns true if the string starts with substring.
Parameters:
string - the CharSequence to be searched
substring - the CharSequence to search for
Returns:
boolean
Returns true if the string starts with substring. If offset is set, it will start matching the substring at that point in the string.
Parameters:
string - the CharSequence to be searched
substring - the CharSequence to search for
offset - the starting point of the search
Returns:
boolean
Returns the substring of string starting from the beginIndex until one before the endIndex. An empty is returned if either index is greater than the length of the string.
Parameters:
string - the string to be parsed
beginIndex - the starting index
endIndex - one after the ending index
Returns:
java.lang.String
Returns the tangent of a double.
Returns:
double
Returns the hyberbolic tangent value of the parameter.
Returns:
double
Converts value to a BigDecimal. This method accepts numbers, objects, and nulls (not just strings). It also trims strings if parsing is needed.
Parameters:
value - the Object to convert
Returns:
java.math.BigDecimal
Converts value to a BigInteger. This method accepts numbers, objects, and nulls (not just strings). It also trims strings if parsing is needed.
Parameters:
value - the Object to convert
Returns:
java.math.BigInteger
Converts value to a java.sql.Date.
Parameters:
value - the Object to convert
Returns:
java.sql.Date
Converts value to a java.util.Date.
Parameters:
value - the Object to convert
Returns:
java.util.Date
Returns the approximate degrees equivalent value of an angle measured in radians.
Returns:
double
Converts value to a Double. This method accepts numbers, objects, and nulls (not just strings). It also trims strings if parsing is needed.
Parameters:
value - the Object to convert
Returns:
java.lang.Double
Converts value to an Integer. This method accepts numbers, objects, and nulls (not just strings). It also trims strings if parsing is needed.
Parameters:
value - the Object to convert
Returns:
java.lang.Integer
Converts value to a Long. This method accepts numbers, objects, and nulls (not just strings). It also trims strings if parsing is needed.
Parameters:
value - the Object to convert
Returns:
java.lang.Long
Converts all the characters in value to lowercase.
Parameters:
value - the Object to be processed
Returns:
java.lang.String
Returns the approximate radians equivalent value of an angle measured in degrees.
Returns:
double
Converts value to a java.sql.Time.
Parameters:
value - the Object to convert
Returns:
java.sql.Time
Converts all the characters in value to uppercase.
Parameters:
value - the Object to be processed
Returns:
java.lang.String
Removes all leading whitespace.
Parameters:
string - the string to be trimmed
Returns:
java.lang.String
Removes all leading characters specified. If padChar is not specified, whitespace is removed.
Parameters:
string - the string to be trimmed
padChar - the character to trim
Returns:
java.lang.String
Removes all trailing whitespace.
Parameters:
string - the string to be trimmed
Returns:
java.lang.String
Removes all trailing characters specified. If padChar is not specified, whitespace is removed.
Parameters:
string - the string to be trimmed
padChar - the character to trim
Returns:
java.lang.String
Returns a number representing the week of the year (0–53) of the input date or null if the specified date is null.
Returns:
java.lang.Integer
Returns the date's year or null if the specified date is null.
Returns:
java.lang.Integer

examples

Mobile Analytics