Package com.isomorphic.criteria
Class DefaultOperators
java.lang.Object
com.isomorphic.criteria.DefaultOperators
Helper class for accessing operators that needs for working with Criteria. Also it contains set of methods for values check.
You can use any operator directly like DefaultOperators.Equals or you can get all of them using getDefaultOperatorMap()
method.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic OperatorBase
All subcriteria (criterion.criteria) are true.static OperatorBase
Shortcut for greaterThan + lessThan + and.static OperatorBase
Shortcut for greaterOrEqual + lessOrEqual + and.static OperatorBase
Contains as sub-string (match case).static OperatorBase
Contains as sub-string (match case) another field value (specify fieldName as criterion.value).static OperatorBase
Glob expression match.static OperatorBase
Ends with (match case).static OperatorBase
Ends with (match case) another field value (specify fieldName as criterion.value).static OperatorBase
Glob expression ends match.static OperatorBase
Exactly equal to.static OperatorBase
Matches another field (specify fieldName as criterion.value).static OperatorBase
Greater than or equal to.static OperatorBase
Greater than or equal to another field (specify fieldName as criterion.value).static OperatorBase
Greater than.static OperatorBase
Greater than another field (specify fieldName as criterion.value).static OperatorBase
Shortcut for greaterThan + lessThan + and (case insensitive)static OperatorBase
Shortcut for greaterOrEqual + lessOrEqual + and (case insensitive)static OperatorBase
Contains as sub-string (case insensitive).static OperatorBase
Contains as sub-string another field value (specify fieldName as criterion.value).static OperatorBase
Glob expression match (case insensitive).static OperatorBase
Ends with (case insensitive).static OperatorBase
Ends with another field value (specify fieldName as criterion.value).static OperatorBase
Glob expression ends match.static OperatorBase
exactly equal to, if case is disregarded.static OperatorBase
Matches another field ignoring case (specify fieldName as criterion.value).static OperatorBase
Glob expression match (case insensitive).static OperatorBase
Does not contain as sub-string (case insensitive).static OperatorBase
Does not contain a sub-string of another field value (specify fieldName as criterion.value).static OperatorBase
Does not end with (case insensitive).static OperatorBase
Does not end with another field value (specify fieldName as criterion.value).static OperatorBase
Not equal to, if case is disregarded.static OperatorBase
Does not match another field ignoring case (specify fieldName as criterion.value).static OperatorBase
Does not start with (case insensitive).static OperatorBase
Does not start with another field value (specify fieldName as criterion.value)static OperatorBase
Value is in a set of values.static OperatorBase
Regular expression match (case insensitive).static OperatorBase
Value is blank.static OperatorBase
Value is null.static OperatorBase
Starts with (case insensitive).static OperatorBase
Starts with another field value (specify fieldName as criterion.value)static OperatorBase
Glob expression start match.static OperatorBase
Less than or equal to.static OperatorBase
Less than or equal to another field (specify fieldName as criterion.value).static OperatorBase
Less than.static OperatorBase
Less than another field (specify fieldName as criterion.value).static OperatorBase
Glob expression match.static OperatorBase
All subcriteria (criterion.criteria) are false.static OperatorBase
Value is non-blank.static OperatorBase
Does not contain as sub-string (match case).static OperatorBase
Does not contain a sub-string (match case) of another field value (specify fieldName as criterion.value).static OperatorBase
Does not end with (match case).static OperatorBase
Does not end with (match case) another field value (specify fieldName as criterion.value).static OperatorBase
Not equal to.static OperatorBase
Does not match another field (specify fieldName as criterion.value).static OperatorBase
Value is not in a set of values.static OperatorBase
Value is non-null.static OperatorBase
Does not start with (match case).static OperatorBase
Does not start with (match case) another field value (specify fieldName as criterion.value)static OperatorBase
At least one subcriteria (criterion.criteria) is true.static OperatorBase
Regular expression match.static OperatorBase
Starts with (match case).static OperatorBase
Starts with (match case) another field value (specify fieldName as criterion.value)static OperatorBase
Glob expression start match. -
Method Summary
Modifier and TypeMethodDescriptionRetrieving the Map containing all default operators.static boolean
isEndsWithPattern
(String value, String matchesPattern, boolean ignoreCase) Checks to see if the value ends with the pattern described allowing for multi wildcard character '*' and single wildcard characters '%' and '?'static boolean
Compare two objects in a style suitable for Advanced Criteria operators.static boolean
isEqualToConfiguredValue
(Object value, String operand) Returns true if argument "value" (presumed to come from a DataSource) is equal to the value represented by argument "operand" (a String, presumed to come from a .ds.xml file).static boolean
isMatchingPattern
(String value, String matchesPattern, boolean ignoreCase) Checks to see if the value matches the pattern described allowing for multi wildcard character '*' and single wildcard characters '%' and '?'static boolean
isStartsWithPattern
(String value, String matchesPattern, boolean ignoreCase) Checks to see if the value starts with the pattern described allowing for multi wildcard character '*' and single wildcard characters '%' and '?'static boolean
rangeCheck
(Object value, Object lower, Object upper, boolean inclusive, boolean caseInsensitive) Evaluates: "lower (< <=) value (< <=) upper", where lower, value, and upper are presumed to be objects of (nearly) the same type.static boolean
rangeCheckToConfiguredValues
(Object value, String lower, String upper, boolean inclusive, boolean caseInsensitive) Evaluates: "lower (< <=) value (< <=) upper", where value is an object (presumably from a record), and lower and upper are Strings, presumably parsed from a .ds.xml file, which are converted to the type of value prior to comparison.
-
Field Details
-
Equals
Exactly equal to. -
NotEqual
Not equal to. -
IEquals
exactly equal to, if case is disregarded. -
INotEqual
Not equal to, if case is disregarded. -
GreaterThan
Greater than. -
LessThan
Less than. -
GreaterOrEqual
Greater than or equal to. -
LessOrEqual
Less than or equal to. -
Between
Shortcut for greaterThan + lessThan + and. -
IBetween
Shortcut for greaterThan + lessThan + and (case insensitive) -
BetweenInclusive
Shortcut for greaterOrEqual + lessOrEqual + and. -
IBetweenInclusive
Shortcut for greaterOrEqual + lessOrEqual + and (case insensitive) -
IContains
Contains as sub-string (case insensitive). -
IStartsWith
Starts with (case insensitive). -
IEndsWith
Ends with (case insensitive). -
Contains
Contains as sub-string (match case). -
StartsWith
Starts with (match case). -
EndsWith
Ends with (match case). -
INotContains
Does not contain as sub-string (case insensitive). -
INotStartsWith
Does not start with (case insensitive). -
INotEndsWith
Does not end with (case insensitive). -
NotContains
Does not contain as sub-string (match case). -
NotStartsWith
Does not start with (match case). -
NotEndsWith
Does not end with (match case). -
IsBlank
Value is blank. -
NotBlank
Value is non-blank. -
IsNull
Value is null. -
NotNull
Value is non-null. -
Regexp
Regular expression match. -
Iregexp
Regular expression match (case insensitive). -
StartsWithPattern
Glob expression start match. Multi wildcard character allowed is '*' Single wildcard characters allowed are '%' and '?' -
IStartsWithPattern
Glob expression start match. Multi wildcard character allowed is '*' Single wildcard characters allowed are '%' and '?' -
EndsWithPattern
Glob expression ends match. Multi wildcard character allowed is '*' Single wildcard characters allowed are '%' and '?' -
IEndsWithPattern
Glob expression ends match. Multi wildcard character allowed is '*' Single wildcard characters allowed are '%' and '?' -
MatchesPattern
Glob expression match. Multi wildcard character allowed is '*' Single wildcard characters allowed are '%' and '?' -
IMatchesPattern
Glob expression match (case insensitive). Multi wildcard character allowed is '*' Single wildcard characters allowed are '%' and '?' -
ContainsPattern
Glob expression match. Multi wildcard character allowed is '*' Single wildcard characters allowed are '%' and '?' -
IContainsPattern
Glob expression match (case insensitive). Multi wildcard character allowed is '*' Single wildcard characters allowed are '%' and '?' -
InSet
Value is in a set of values. -
NotInSet
Value is not in a set of values. -
EqualsField
Matches another field (specify fieldName as criterion.value). -
IEqualsField
Matches another field ignoring case (specify fieldName as criterion.value). This relies on the field values being strings. -
NotEqualField
Does not match another field (specify fieldName as criterion.value). -
INotEqualField
Does not match another field ignoring case (specify fieldName as criterion.value). This relies on the field values being strings. -
And
All subcriteria (criterion.criteria) are true. -
Not
All subcriteria (criterion.criteria) are false. -
Or
At least one subcriteria (criterion.criteria) is true. -
GreaterThanField
Greater than another field (specify fieldName as criterion.value). -
LessThanField
Less than another field (specify fieldName as criterion.value). -
GreaterOrEqualField
Greater than or equal to another field (specify fieldName as criterion.value). -
LessOrEqualField
Less than or equal to another field (specify fieldName as criterion.value). -
ContainsField
Contains as sub-string (match case) another field value (specify fieldName as criterion.value). -
IContainsField
Contains as sub-string another field value (specify fieldName as criterion.value). -
NotContainsField
Does not contain a sub-string (match case) of another field value (specify fieldName as criterion.value). -
INotContainsField
Does not contain a sub-string of another field value (specify fieldName as criterion.value). -
StartsWithField
Starts with (match case) another field value (specify fieldName as criterion.value) -
IStartsWithField
Starts with another field value (specify fieldName as criterion.value) -
NotStartsWithField
Does not start with (match case) another field value (specify fieldName as criterion.value) -
INotStartsWithField
Does not start with another field value (specify fieldName as criterion.value) -
EndsWithField
Ends with (match case) another field value (specify fieldName as criterion.value). -
IEndsWithField
Ends with another field value (specify fieldName as criterion.value). -
NotEndsWithField
Does not end with (match case) another field value (specify fieldName as criterion.value). -
INotEndsWithField
Does not end with another field value (specify fieldName as criterion.value).
-
-
Method Details
-
isEqualToConfiguredValue
Returns true if argument "value" (presumed to come from a DataSource) is equal to the value represented by argument "operand" (a String, presumed to come from a .ds.xml file). Otherwise returns false.This is meant to be a wrapper class around isEqual(), handling the most common cases of type conversion and data conditioning.
- Throws:
Exception
-
isEqual
Compare two objects in a style suitable for Advanced Criteria operators. This should follow the same equality semantics as implemented in DataSource.js. It should also generally follow equality semantics for SQL.- Throws:
Exception
-
rangeCheckToConfiguredValues
public static boolean rangeCheckToConfiguredValues(Object value, String lower, String upper, boolean inclusive, boolean caseInsensitive) throws Exception Evaluates: "lower (< <=) value (< <=) upper", where value is an object (presumably from a record), and lower and upper are Strings, presumably parsed from a .ds.xml file, which are converted to the type of value prior to comparison.- Throws:
Exception
-
rangeCheck
public static boolean rangeCheck(Object value, Object lower, Object upper, boolean inclusive, boolean caseInsensitive) throws Exception Evaluates: "lower (< <=) value (< <=) upper", where lower, value, and upper are presumed to be objects of (nearly) the same type.- Throws:
Exception
-
isMatchingPattern
public static boolean isMatchingPattern(String value, String matchesPattern, boolean ignoreCase) throws Exception Checks to see if the value matches the pattern described allowing for multi wildcard character '*' and single wildcard characters '%' and '?'- Throws:
Exception
-
isStartsWithPattern
public static boolean isStartsWithPattern(String value, String matchesPattern, boolean ignoreCase) throws Exception Checks to see if the value starts with the pattern described allowing for multi wildcard character '*' and single wildcard characters '%' and '?'- Throws:
Exception
-
isEndsWithPattern
public static boolean isEndsWithPattern(String value, String matchesPattern, boolean ignoreCase) throws Exception Checks to see if the value ends with the pattern described allowing for multi wildcard character '*' and single wildcard characters '%' and '?'- Throws:
Exception
-
getDefaultOperatorMap
Retrieving the Map containing all default operators.- Returns:
- all default operators as map(id->operator).
-