Expression Language
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.
|
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.
Blacklisted Methods
DPEL contains a set of blacklisted methods we think are unsafe from a security point-of-view. Trying to execute them in an expression will fail with an exception.
This behavior can be overridden by explicitly whitelisting any methods, classes, or packages you wish to call using Functions.addWhitelistPrefix(String...). You can also blacklist additional methods using Functions.addBlacklistPrefix(String...) before executing your expression.
Blacklisting and whitelisting work by examining the prefix of the fully-qualified method being called. For example, java.lang.Runtime.exit(int)
will not execute because it starts with "java.lang.Runtime".
Here is the list of blacklisted method prefixes in DPEL:
- com.oracle
- com.sun
- java.applet
- java.awt
- java.beans
- java.io
- java.lang.Class
- java.lang.Compiler
- java.lang.instrument
- java.lang.invoke
- java.lang.management.
- java.lang.reflect
- java.lang.Runtime
- java.lang.SecurityManager
- java.lang.System
- java.lang.Thread
- java.net
- java.nio
- java.rmi
- java.security
- java.sql
- java.util.concurrent
- java.util.jar
- java.util.logging
- java.util.prefs
- java.util.zip
- javax.accessibility
- javax.activation
- javax.crypto
- javax.image
- javax.jws
- javax.management
- javax.naming
- javax.net
- javax.print
- javax.rmi
- javax.script
- javax.security
- javax.sound
- javax.sql
- javax.swing
- javax.tools
- javax.transaction
- javax.xml
- jdk
- netscape.javascript
- org.ietf.jgss
- org.jcp
- org.omg
- sun
See the Blacklist and Whitelist Functions in DP Expression Language example for a demo to blacklist or whitelist a class or package.
Examples
The following examples all use the built-in expression language.
- Add my own functions
- Blacklist and Whitelist Functions in DP Expression Language
- Filter records
- Search for a Record
- Set a calculated field at runtime
- Validate incoming data
Built-in Functions by Category
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. |
bytesToUuid(byte[] value) | Converts an array of byte value to a java.util.UUID . |
capitalize(String value) | Capitalizes a string by changing the first letter to upper case. No other letters are changed. |
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. |
countDigits(String string) | Counts the number of digits in a string. |
countLetters(String string) | Counts the number of letters in a string. |
countLowercaseLetters(String string) | Counts the number of lowercase letters in a String. |
countSymbols(String string) | Counts the number of symbols in a string. |
countUppercaseLetters(String string) | Counts the number of uppercase letters in a String. |
currentTimeMillis() | Returns the current time in milliseconds since midnight, January 1, 1970 UTC. |
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. |
daysToDate(Number number) | Returns a Date by converting the given number as days. |
daysToDateTime(Number number) | Returns a Date that has the given Number input set as the time in days |
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). |
deleteString(int start, int end, String value) | Returns a copy of the string with the characters deleted from the specified start and end indexes |
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. |
formatNumber(Number number, String pattern) | Converts a Number to a string using the specified format pattern. |
getCharacterCount(String string, char searchChar) | Returns the number of searchChar s contained in string or zero (0). |
getField(Record record, int fieldIndex) | Returns the field value in the specified records by index. |
getField(Record record, String fieldName) | Returns the field value in the specified records by name. |
getRandomString(int length) | Returns a random string with the specified length . |
getValue(RecordContainer recordContainer, String fieldPathExpression, Object defaultValue) | Returns the value at the specified path in the record or the defaultValue if the value is null or doesn't exist. |
hour(Date date) | Returns a number representing the hour of the day of the input date or null if the specified date is null. |
hoursToDate(Number number) | Returns a Date by converting the given number as hours. |
hoursToDateTime(Number number) | Returns a Date that has the given Number input set as the time in hours |
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. |
insertString(int index, String orignalString, String stringToInsert) | Returns a copy of the original string with the second string parameter inserted at the specified index. |
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) |
intervalToMilliseconds(Interval interval) | Returns a Date by converting the given number as days. |
intervalToMonths(Interval interval) | Returns a Date by converting the given number as days. |
intervalToSeconds(Interval interval) | Returns a Date by converting the given number as days. |
intervalToYears(Interval interval) | Returns a Date by converting the given number as days. |
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. |
lookup(Lookup lookupSource, Object ... lookupKeys) | Returns the first record found (or null) after performing a lookup using the specified source and keys. |
lookup(int fieldIndex, Lookup lookupSource, Object ... lookupKeys) | Performs a lookup using the specified source and keys and returns the field value by index in the first record found (or null). |
lookup(String fieldName, Lookup lookupSource, Object ... lookupKeys) | Performs a lookup using the specified source and keys and returns the field value by name in the first record found (or null). |
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. |
matchesRegex(String string, String regex, boolean ignoreCase, boolean dotAll, boolean multiLine) | Returns true if the provided string matches the regular expression using the given flags. |
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. |
md5(Object ... values) | Applies the MD5 message digest algorithm to values and returns it as a string. |
millisecond(Date date) | Returns a number representing the millisecond within the second of the input date or null if the specified date is null. |
millisecondsToDate(Number number) | Returns a Date by converting the given number as milliseconds. |
millisecondsToDateTime(Number number) | Returns a Date that has the given Number input set as the time in milliseconds |
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. |
minutesToDate(Number number) | Returns a Date by converting the given number as minutes. |
minutesToDateTime(Number number) | Returns a Date that has the given Number input set as the time in minutes |
month(Date date) | Returns the date's month (1-12) or null if the specified date is null. |
nanoTime() | Returns the current value of the high-resolution time source in nanoseconds. |
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. |
parseByte(String s) | Returns a byte 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. |
parseFloat(String s) | Returns a float initialized to the value of the specified string. |
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. |
parseShort(String s) | Returns a short initialized to the value of the specified string. |
print(Object value) | Writes a value to the console. |
println() | Writes a new line to the console. |
println(Object value) | Writes a value followed by a new line to the console. |
random() | Returns a pseudorandomly chosen value between 0.0,and 1.0 |
recordContainsField(RecordContainer recordContainer, String fieldPathExpression) | Indicates if a record contains a matching field for the specified path. This method will return false if the path matches an array
value (for example city[2] or customer.address[0].city[2] ) instead of a field. |
recordContainsNonNullField(RecordContainer recordContainer, String fieldPathExpression) | Indicates if a record contains a field at the specified path that is not null. |
recordContainsNonNullValue(RecordContainer recordContainer, String fieldPathExpression) | Indicates if a record contains a field or value at the specified path where the value is not null. |
recordContainsValue(RecordContainer recordContainer, String fieldPathExpression) | Indicates if a record contains a matching field or value for the specified path. |
repeat(String string, int count) | Creates a new string out of the string provided, appended count times. |
replaceAllRegex(String orignalString, CharSequence regex, CharSequence replacement) | Returns a new string where all substring occurrences that matches the given regular expression has been replaced by the given replacement. |
replaceChar(String original, char oldChar, char newChar) | Returns a new string where all the occurrences of the oldChar has been replaced by the newChar |
replaceFirstRegex(String orignalString, CharSequence regex, CharSequence replacement) | Returns a new string where the first occurrence of the substring that matches the given regular expression has been replaced by the given replacement. |
replaceString(String orignalString, CharSequence oldString, CharSequence newString) | Returns a new string where all the occurrences of the oldChar has been replaced by the newChar |
replaceSubstring(int start, int end, String original, String replacement) | Returns a copy of the string with the characters replaced by the given replacement from the specified start and end indexes |
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 |
round(Number number, int decimalPlaces) | Returns a Number scaled according to the specified decimal places using RoundingMode.HALF_UP . |
second(Date date) | Returns a number representing the second within the minute of the input date or null if the specified date is null. |
secondsToDate(Number number) | Returns a Date by converting the given number as seconds. |
secondsToDateTime(Number number) | Returns a Date that has the given Number input set as the time in seconds |
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. |
stringToUuid(String value) | Converts a string value to a java.util.UUID . |
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. |
substring(String string, int beginIndex) | Returns the substring of string starting from the beginIndex .
An empty string is returned if the index is greater than the length of the string. |
swapCase(String value) | Toggles the case of a string by changing upper to lower case and lower case to upper case. |
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. |
toBoolean(Object value) | Converts value to a Boolean . |
toByte(Object value) | Converts value to a byte . This method accepts numbers, objects, and nulls (not just strings). It also trims strings if parsing is needed. |
toChar(Object value) | Converts any value to a single Character . If the supplied value is null or empty string, then null will be returned.
If the supplied value has more than one character, then the first character will be returned. |
toDate(Object value) | Converts value to a java.sql.Date . |
toDatetime(Object 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. |
toFloat(Object value) | Converts value to a float . 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. |
toLowerCaseFirstChar(String value) | Returns a copy string with the first letter in lower case. |
toRadians(double a) | Returns the approximate radians equivalent value of an angle measured in degrees. |
toShort(Object value) | Converts value to a short . This method accepts numbers, objects, and nulls (not just strings). It also trims strings if parsing is needed. |
toString(Object value) | Converts any value to a String . If the supplied value is null, then null will be returned. |
toTime(Object value) | Converts value to a java.sql.Time . |
toTimestamp(Object value) | Converts value to a java.sql.Timestamp . |
toUpperCase(Object value) | Converts all the characters in value to uppercase. |
toUpperCaseFirstChar(String value) | Returns a copy of the string with the first letter in upper case. |
toUuid(Object value) | Converts value to a java.util.UUID . |
trim(String value) | Returns a copy of the string where the leading and trailing whitepsaces removed. |
trimFrom(String string, String substring) | Removes the first instance of the substring and all characters after it. |
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. |
trimTo(String string, String substring) | Removes all characters up to and including the first instance of the substring. |
uncapitalize(String value) | Removes capitalization from a string by changing the first letter to lower case. No other letters are changed. |
uuidToBytes(UUID uuid) | Converts UUID value to a an array of byte . |
uuidToString(UUID uuid) | Converts UUID value to a String . |
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
- a - the int value whose absolute value is to be determined
- a - the long value whose absolute value is to be determined
- a - the double value whose absolute value is to be determined
- a - the BigInteger value whose absolute value is to be determined
- a - the BigDecimal value whose absolute value is to be determined
Objects
to a String
separated by the separator.- array -
Object
array - separator - the separator for the Objects
int
array to a String
separated by the separator.- array -
int
array - separator - the separator for the
ints
long
array to a String
separated by the separator.- array -
long
array - separator - the separator for the
longs
double
array to a String
separated by the separator.- array -
double
array - separator - the separator for the
doubles
List<?>
to a String
separated by the separator.- array - a
List<?>
- separator - the separator for the
List<?>
bytes
to a hexadecimal string.- bytes - the array of
bytes
to convert
an array of byte value
to a java.util.UUID
.- value - the
byte[]
to convert
- value - the
String
to be processed
- expression - an array of Objects
int
.
(e.g., column A = 0, column CW = 100, column AB = 27)- columnName - the string to convert
Objects
. Returns 0 if both objects are equal, -1 if the first
object is null, 1 if the second object in null.- o1 - the first
Object
- o2 - the second
Object
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
.- s1 - the first string to compare to
- s2 - the second string to compare to
- caseSensitive - set to
false
to ignore case
true
if the string contains the substring. It will match the exact case.- string - the string to be searched
- substring - the string to search for
true
if the string contains the substring. If caseSensitive
is true, it will match the exact case.- string - the string to be searched
- substring - the string to search for
- caseSensitive - set to
true
to match exact case
true
if the string element is contained in the array of string elements. If caseSensitive
is true, it will match the exact case.- elements - array of strings to be searched
- element - the string to search for
- caseSensitive - set to
true
to match exact case
null
if the specified date is null.null
if the specified date is null.null
if the specified date is null.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).- expression - the
Object
to search for - search1 - the first
Object
to be matched withexpression
- result1 - returned when
expression
equalssearch1
- searchResultDefault - an array of search pairs (search and result)
null
if the string is empty. Otherwise, the same string is returned.- s - a string
true
if the string ends with the substring. If caseSensitive
is true,
it will match the exact case.- string - the string to be searched
- substring - the string to search for
- caseSensitive - set to
true
to match exact case
true
if the string ends with the substring.- string - the
CharSequence
to be searched - substring - the
CharSequence
to search for
true
if both Objects
are equal.- expression1 - the first
Object
to compare - expression2 - the second
Object
to compare
java.util.Date
to a string using the specified format pattern.- date - the date to be formatted as a string.
- pattern - the pattern describing the date and time format.
Double
to a string using the specified format pattern.- number - the value to format
- pattern - the pattern describing the number format.
Long
to a string using the specified format pattern.- number - the value to format
- pattern - the pattern describing the number format.
Number
to a string using the specified format pattern.- number - the value to format
- pattern - the pattern describing the number format.
searchChar
s contained in string
or zero (0).- string - the string to be searched
- searchChar - the character to search for
length
.- length - the resulting length of the string
- recordContainer - the {@link Record} or {@link ExpressionContext} to search
- fieldPathExpression - the nested field path expression {@link FieldPath}
- defaultValue - the value to return if the field path expression doesn't exist or contains null
null
if the specified date is null.trueResult
if booleanExpression
is true, otherwise returns falseResult
.- 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
caseSensitive
is true, it will match the exact case.- string - the string to be searched
- substring - the string to search for
- caseSensitive - set to
true
to match exact case
int
to a string column name. Similar to spreadsheet column names.
(e.g., column 27 = AB, column 100 = CW, column 0 = A)- column - the number to convert
true
if the string is empty, null
or all whitespaces.- s - the string to be processed
true
if the string is not empty or is not null
.- s - the string to be processed
true
if actual
equals one of the integers in expected
.- actual - the
int
to compare - expected - the array of
int
to be compared with
true
if actual
equals one of the objects in expected
.- actual - the
Object
to compare - expected - the array of
Objects
to be compared with
length.
- string - the string to be parsed
- length - the number of characters to return
value
.- value - the
Object
to be processed
caseSensitive
is true, it will match the exact case. If
allowEmpty
is true, it will allow matching with an empty string.- 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
caseSensitive
is true, it will match the exact case.- s1 - the first string to match
- s2 - the second string to match
- caseSensitive - set to
true
to match exact case
- s1 - the first string to match
- s2 - the second string to match
- string - - The string to be checked with the regular expression
- regex - - The Regular Expression to be used
- ignoreCase - - Disables case-sensitive matching when set to true
- dotAll - - When set to
true
the expression . will match any character including line separators - multiLine - - When set to
true
, this method will returntrue
if any of the lines match the provided regular expression
values
and returns it as a string.- values - the
Object
array to be hashed
null
if the specified date is null.null
if the specified date is null.null
if the specified date is null.null
if the two expressions are equal, otherwise returns expression1.- expression1 - the first
Object
to compare - expression2 - the second
Object
to compare
length
is the
resulting size of the string with padding.- string - the string to be padded
- length - the resulting size of the string with padding
- padChar - the character to add/pad
length
is the
resulting size of the string with padding.- string - the string to be padded
- length - the resulting size of the string with padding
- padChar - the character to add/pad
BigDecimal
initialized to the value of the specified string.- s - the string to be parsed
BigInteger
initialized to the value of the specified string.- s - the string to be parsed
boolean
initialized to the value of the specified string.- s - the string to be parsed
byte
initialized to the value of the specified string.- s - the string to be parsed
java.util.Date
using the specified pattern.- value - the string to parse.
- pattern - the pattern describing the date and time format.
double
initialized to the value of the specified string.- s - the string to be parsed
double
using the specified format pattern.- number - the value to parse.
- pattern - the pattern describing the number format.
float
initialized to the value of the specified string.- s - the string to be parsed
int
initialized to the value of the specified string.- s - the string to be parsed
long
initialized to the value of the specified string.- s - the string to be parsed
long
using the specified format pattern.- number - the value to parse.
- pattern - the pattern describing the number format.
short
initialized to the value of the specified string.- s - the string to be parsed
city[2]
or customer.address[0].city[2]
) instead of a field.- recordContainer - the {@link Record} or {@link ExpressionContext} to search
- fieldPathExpression - the nested field path expression {@link FieldPath}
- recordContainer - the {@link Record} or {@link ExpressionContext} to search
- fieldPathExpression - the nested field path expression {@link FieldPath}
- recordContainer - the {@link Record} or {@link ExpressionContext} to search
- fieldPathExpression - the nested field path expression {@link FieldPath}
- recordContainer - the {@link Record} or {@link ExpressionContext} to search
- fieldPathExpression - the nested field path expression {@link FieldPath}
count
times.- string - the string to append
- count - the number of times to append the string
length
.- string - the string to be parsed
- length - the number of characters to return
Number
scaled according to the specified decimal places using RoundingMode.HALF_UP
.null
if the specified date is null.values
and returns it as a string.- values - the
Object
array to be hashed
values
and returns it as a string.- values - the
Object
array to be hashed
true
if the string starts with substring. If caseSensitive
is true, it will
match the exact case.- string - the string to be searched
- substring - the substring to search for
- caseSensitive - set to
true
to match exact case
true
if the string starts with substring.- string - the
CharSequence
to be searched - substring - the
CharSequence
to search for
true
if the string starts with substring. If offset
is set, it will start
matching the substring at that point in the string.- string - the
CharSequence
to be searched - substring - the
CharSequence
to search for - offset - the starting point of the search
a string value
to a java.util.UUID
.- value - the
String
to convert
beginIndex
until one before the endIndex
.
An empty is returned if either index is greater than the length of the string.- string - the string to be parsed
- beginIndex - the starting index
- endIndex - one after the ending index
beginIndex
.
An empty string is returned if the index is greater than the length of the string.- string - the string to be parsed
- beginIndex - the starting index
- value - the
String
to be processed
value
to a BigDecimal
. This method accepts numbers, objects, and nulls (not just strings). It also trims strings if parsing is needed.- value - the
Object
to convert
value
to a BigInteger
. This method accepts numbers, objects, and nulls (not just strings). It also trims strings if parsing is needed.- value - the
Object
to convert
value
to a Boolean
.- value - the
Object
to convert
value
to a byte
. This method accepts numbers, objects, and nulls (not just strings). It also trims strings if parsing is needed.- value - the
Object
to convert
value
to a single Character
. If the supplied value is null or empty string, then null will be returned.
If the supplied value has more than one character, then the first character will be returned.- value - the
Object
to convert
value
to a java.sql.Date
.- value - the
Object
to convert
value
to a java.util.Date
.- value - the
Object
to convert
value
to a Double
. This method accepts numbers, objects, and nulls (not just strings). It also trims strings if parsing is needed.- value - the
Object
to convert
value
to a float
. This method accepts numbers, objects, and nulls (not just strings). It also trims strings if parsing is needed.- value - the
Object
to convert
value
to an Integer
. This method accepts numbers, objects, and nulls (not just strings). It also trims strings if parsing is needed.- value - the
Object
to convert
value
to a Long
. This method accepts numbers, objects, and nulls (not just strings). It also trims strings if parsing is needed.- value - the
Object
to convert
value
to lowercase.- value - the
Object
to be processed
value
to a short
. This method accepts numbers, objects, and nulls (not just strings). It also trims strings if parsing is needed.- value - the
Object
to convert
value
to a String
. If the supplied value is null, then null will be returned.- value - the
Object
to convert
value
to a java.sql.Time
.- value - the
Object
to convert
value
to a java.sql.Timestamp
.- value - the
Object
to convert
value
to uppercase.- value - the
Object
to be processed
value
to a java.util.UUID
.- value - the
Object
to convert
- string - the string to be trimmed
padChar
is not specified, whitespace is removed.- string - the string to be trimmed
- padChar - the character to trim
- string - the string to be trimmed
padChar
is not specified, whitespace is removed.- string - the string to be trimmed
- padChar - the character to trim
- value - the
String
to be processed
UUID value
to a an array of byte
.- uuid - the
UUID
to convert
UUID value
to a String
.- value - the
String
to convert
null
if the specified date is null.null
if the specified date is null.