Package ortus.boxlang.runtime.operators
Class StringCompare
java.lang.Object
ortus.boxlang.runtime.operators.StringCompare
- All Implemented Interfaces:
IOperator
Operator to compare two strings and bypass any additional cast attempts
-
Constructor Details
-
StringCompare
public StringCompare()
-
-
Method Details
-
invoke
Invokes the comparison- Parameters:
left
- The left operandright
- The right operand- Returns:
- 1 if greater than, -1 if less than, = if equal
-
invoke
Invokes the comparison- Parameters:
left
- The left operandright
- The right operandcaseSensitive
- Whether to compare strings case sensitive- Returns:
- 1 if greater than, -1 if less than, = if equal
-
invoke
Invokes the comparison- Parameters:
left
- The left operandright
- The right operandcaseSensitive
- Whether to compare strings case sensitivelocale
- The locale to use for comparison- Returns:
- 1 if greater than, -1 if less than, = if equal
-
attempt
Invokes the comparison- Parameters:
left
- The left operandright
- The right operandcaseSensitive
- Whether to compare strings case sensitivefail
- True to throw an exception if the left and right arguments cannot be compared- Returns:
- 1 if greater than, -1 if less than, = if equal
-
attempt
public static Integer attempt(String left, String right, Boolean caseSensitive, boolean fail, Locale locale) Invokes the comparison- Parameters:
left
- The left operandright
- The right operandcaseSensitive
- Whether to compare strings case sensitivefail
- True to throw an exception if the left and right arguments cannot be comparedlocale
- The locale to use for comparison- Returns:
- 1 if greater than, -1 if less than, = if equal
-