public class ConditionUtil extends java.lang.Object implements ConditionConstants
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
COPYRIGHT
Copyright.
|
AND_LIST_CONDITION, FALSE_VALUE, OPEN_CONDITION, OPERATOR_CONTAINS, OPERATOR_DOES_NOT_CONTAIN, OPERATOR_DOES_NOT_END_WITH, OPERATOR_DOES_NOT_START_WITH, OPERATOR_ENDS_WITH, OPERATOR_EQUAL_TO, OPERATOR_GREATER_THAN, OPERATOR_GREATER_THAN_OR_EQUAL_TO, OPERATOR_LESS_THAN, OPERATOR_LESS_THAN_OR_EQUAL_TO, OPERATOR_NOT_EQUAL_TO, OPERATOR_STARTS_WITH, OR_LIST_CONDITION, SIMPLE_CONDITION, TRUE_CONDITION, TRUE_VALUE, XML_DTD_FRAGMENT, XML_INDENT
Constructor and Description |
---|
ConditionUtil() |
Modifier and Type | Method and Description |
---|---|
static boolean |
evaluate2Strings(java.lang.String value1,
java.lang.String value2,
java.lang.String operator,
java.lang.String value3)
This method will compare two string values to a third using the specified operator.
|
static boolean |
evaluate2StringsIgnoreCase(java.lang.String value1,
java.lang.String value2,
java.lang.String operator,
java.lang.String value3)
This method will compare two string values to a third using the specified operator.
|
static boolean |
evaluateBigDecimal(java.math.BigDecimal value1,
java.lang.String operator,
java.math.BigDecimal value2)
This method will compare two big decimal values using the specified operator.
|
static boolean |
evaluateDate(java.lang.String value1,
java.lang.String operator,
java.lang.String value2)
This method will compare two date values using the specified operator.
|
static boolean |
evaluateDurationInDays(java.sql.Timestamp timestamp,
java.lang.String operator,
java.lang.Integer value)
This method will compare a timestamp to an integer value using the specified operator.
|
static boolean |
evaluateDurationInDays(java.sql.Timestamp timestamp,
java.lang.String operator,
java.lang.Integer value,
java.sql.Timestamp compareTime)
This method will compare a timestamp to an integer value using the specified operator.
|
static boolean |
evaluateInteger(java.lang.Integer value1,
java.lang.String operator,
java.lang.Integer value2)
This method will compare two integer values using the specified operator.
|
static boolean |
evaluateString(java.lang.String value1,
java.lang.String operator,
java.lang.String value2)
This method will compare two string values using the specified operator.
|
static boolean |
evaluateStringIgnoreCase(java.lang.String value1,
java.lang.String operator,
java.lang.String value2)
This method will compare two string values using the specified operator.
|
static java.sql.Timestamp |
getCurrentTime(ActivityToken token)
This method returns the current time.
|
static Condition |
removeSimpleConditionFromList(Condition condition,
java.lang.String conditionVariable)
This method takes a condition object and a variable name, and removes all simple condition objects
with the given variable name within the given condition object.
|
public static final java.lang.String COPYRIGHT
public static boolean evaluateString(java.lang.String value1, java.lang.String operator, java.lang.String value2)
value1
- a string valueoperator
- the operator used to compare the string values. The following
values are supported:
OPERATOR_EQUAL_TO
OPERATOR_NOT_EQUAL_TO
OPERATOR_STARTS_WITH
OPERATOR_DOES_NOT_START_WITH
OPERATOR_ENDS_WITH
OPERATOR_DOES_NOT_END_WITH
OPERATOR_CONTAINS
OPERATOR_DOES_NOT_CONTAIN
value2
- a string valuetrue
if the expression evaluates to true.public static boolean evaluateStringIgnoreCase(java.lang.String value1, java.lang.String operator, java.lang.String value2)
value1
- a string valueoperator
- the operator used to compare the string values. The following
values are supported:
OPERATOR_EQUAL_TO
OPERATOR_NOT_EQUAL_TO
OPERATOR_STARTS_WITH
OPERATOR_DOES_NOT_START_WITH
OPERATOR_ENDS_WITH
OPERATOR_DOES_NOT_END_WITH
OPERATOR_CONTAINS
OPERATOR_DOES_NOT_CONTAIN
value2
- a string valuetrue
if the expression evaluates to true.public static boolean evaluate2Strings(java.lang.String value1, java.lang.String value2, java.lang.String operator, java.lang.String value3)
value1
- a string valuevalue2
- a string valueoperator
- the operator used to compare the string values. The following
values are supported:
OPERATOR_EQUAL_TO
OPERATOR_NOT_EQUAL_TO
OPERATOR_STARTS_WITH
OPERATOR_DOES_NOT_START_WITH
OPERATOR_ENDS_WITH
OPERATOR_DOES_NOT_END_WITH
OPERATOR_CONTAINS
OPERATOR_DOES_NOT_CONTAIN
value3
- a string valuetrue
if the expression evaluates to true.public static boolean evaluate2StringsIgnoreCase(java.lang.String value1, java.lang.String value2, java.lang.String operator, java.lang.String value3)
value1
- a string valuevalue2
- a string valueoperator
- the operator used to compare the string values. The following
values are supported:
OPERATOR_EQUAL_TO
OPERATOR_NOT_EQUAL_TO
OPERATOR_STARTS_WITH
OPERATOR_DOES_NOT_START_WITH
OPERATOR_ENDS_WITH
OPERATOR_DOES_NOT_END_WITH
OPERATOR_CONTAINS
OPERATOR_DOES_NOT_CONTAIN
value3
- a string valuetrue
if the expression evaluates to true.public static boolean evaluateInteger(java.lang.Integer value1, java.lang.String operator, java.lang.Integer value2)
value1
- an integer valueoperator
- the operator used to compare the integer values. The following
values are supported:
OPERATOR_EQUAL_TO
OPERATOR_NOT_EQUAL_TO
OPERATOR_LESS_THAN
OPERATOR_GREATER_THAN
OPERATOR_LESS_THAN_OR_EQUAL_TO
OPERATOR_GREATER_THAN_OR_EQUAL_TO
value3
- an integer valuetrue
if the expression evaluates to true.public static boolean evaluateBigDecimal(java.math.BigDecimal value1, java.lang.String operator, java.math.BigDecimal value2)
value1
- a big decimal valueoperator
- the operator used to compare the big decimal values. The following
values are supported:
OPERATOR_EQUAL_TO
OPERATOR_NOT_EQUAL_TO
OPERATOR_LESS_THAN
OPERATOR_GREATER_THAN
OPERATOR_LESS_THAN_OR_EQUAL_TO
OPERATOR_GREATER_THAN_OR_EQUAL_TO
value2
- a big decimal valuetrue
if the expression evaluates to true.public static boolean evaluateDurationInDays(java.sql.Timestamp timestamp, java.lang.String operator, java.lang.Integer value, java.sql.Timestamp compareTime)
This method will compare a timestamp to an integer value using the specified operator. The integer value represents the number of days from the specified time.
This method can be used to answer whether or not a given timestamp is the same as, occurs before or occurs after a base, comparison timestamp.
timestamp
- A timestampoperator
- The operator used to compare the timestamps. The following
values are supported:
OPERATOR_EQUAL_TO
OPERATOR_NOT_EQUAL_TO
OPERATOR_LESS_THAN
OPERATOR_GREATER_THAN
OPERATOR_LESS_THAN_OR_EQUAL_TO
OPERATOR_GREATER_THAN_OR_EQUAL_TO
value
- Number of days since the compareTime
.compareTime
- The base timestamp used with value
for comparison to timestamp
.true
if the expression evaluates to true.public static boolean evaluateDurationInDays(java.sql.Timestamp timestamp, java.lang.String operator, java.lang.Integer value)
This method will compare a timestamp to an integer value using the specified operator. The integer value represents the number of days from the current system time.
This method can be used to answer whether or not a given timestamp is the same as, occurs before or occurs after the current system time.
timestamp
- A timestampoperator
- The operator used to compare the timestamps. The following
values are supported:
OPERATOR_EQUAL_TO
OPERATOR_NOT_EQUAL_TO
OPERATOR_LESS_THAN
OPERATOR_GREATER_THAN
OPERATOR_LESS_THAN_OR_EQUAL_TO
OPERATOR_GREATER_THAN_OR_EQUAL_TO
value
- Number of days since the current system time.true
if the expression evaluates to true.public static boolean evaluateDate(java.lang.String value1, java.lang.String operator, java.lang.String value2)
value1
- a date value in the form yyyy-mm-ddoperator
- the operator used to compare the date values. The following
values are supported:
OPERATOR_EQUAL_TO
OPERATOR_NOT_EQUAL_TO
OPERATOR_LESS_THAN
OPERATOR_GREATER_THAN
OPERATOR_LESS_THAN_OR_EQUAL_TO
OPERATOR_GREATER_THAN_OR_EQUAL_TO
value2
- a date value in the form yyyy-mm-ddtrue
if the expression evaluates to true.public static Condition removeSimpleConditionFromList(Condition condition, java.lang.String conditionVariable)
condition
- Original condition object.conditionVariable
- Variable name of the simple condition to be removed.public static java.sql.Timestamp getCurrentTime(ActivityToken token)
token
- The activity token associated with the request. If null
, the current time will be returned.