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 OperatorBaseAll subcriteria (criterion.criteria) are true.static OperatorBaseShortcut for greaterThan + lessThan + and.static OperatorBaseShortcut for greaterOrEqual + lessOrEqual + and.static OperatorBaseContains as sub-string (match case).static OperatorBaseContains as sub-string (match case) another field value (specify fieldName as criterion.value).static OperatorBaseGlob expression match.static OperatorBaseEnds with (match case).static OperatorBaseEnds with (match case) another field value (specify fieldName as criterion.value).static OperatorBaseGlob expression ends match.static OperatorBaseExactly equal to.static OperatorBaseMatches another field (specify fieldName as criterion.value).static OperatorBaseGreater than or equal to.static OperatorBaseGreater than or equal to another field (specify fieldName as criterion.value).static OperatorBaseGreater than.static OperatorBaseGreater than another field (specify fieldName as criterion.value).static OperatorBaseShortcut for greaterThan + lessThan + and (case insensitive)static OperatorBaseShortcut for greaterOrEqual + lessOrEqual + and (case insensitive)static OperatorBaseContains as sub-string (case insensitive).static OperatorBaseContains as sub-string another field value (specify fieldName as criterion.value).static OperatorBaseGlob expression match (case insensitive).static OperatorBaseEnds with (case insensitive).static OperatorBaseEnds with another field value (specify fieldName as criterion.value).static OperatorBaseGlob expression ends match.static OperatorBaseexactly equal to, if case is disregarded.static OperatorBaseMatches another field ignoring case (specify fieldName as criterion.value).static OperatorBaseGlob expression match (case insensitive).static OperatorBaseDoes not contain as sub-string (case insensitive).static OperatorBaseDoes not contain a sub-string of another field value (specify fieldName as criterion.value).static OperatorBaseDoes not end with (case insensitive).static OperatorBaseDoes not end with another field value (specify fieldName as criterion.value).static OperatorBaseNot equal to, if case is disregarded.static OperatorBaseDoes not match another field ignoring case (specify fieldName as criterion.value).static OperatorBaseDoes not start with (case insensitive).static OperatorBaseDoes not start with another field value (specify fieldName as criterion.value)static OperatorBaseValue is in a set of values.static OperatorBaseRegular expression match (case insensitive).static OperatorBaseValue is blank.static OperatorBaseValue is null.static OperatorBaseStarts with (case insensitive).static OperatorBaseStarts with another field value (specify fieldName as criterion.value)static OperatorBaseGlob expression start match.static OperatorBaseLess than or equal to.static OperatorBaseLess than or equal to another field (specify fieldName as criterion.value).static OperatorBaseLess than.static OperatorBaseLess than another field (specify fieldName as criterion.value).static OperatorBaseGlob expression match.static OperatorBaseAll subcriteria (criterion.criteria) are false.static OperatorBaseValue is non-blank.static OperatorBaseDoes not contain as sub-string (match case).static OperatorBaseDoes not contain a sub-string (match case) of another field value (specify fieldName as criterion.value).static OperatorBaseDoes not end with (match case).static OperatorBaseDoes not end with (match case) another field value (specify fieldName as criterion.value).static OperatorBaseNot equal to.static OperatorBaseDoes not match another field (specify fieldName as criterion.value).static OperatorBaseValue is not in a set of values.static OperatorBaseValue is non-null.static OperatorBaseDoes not start with (match case).static OperatorBaseDoes not start with (match case) another field value (specify fieldName as criterion.value)static OperatorBaseAt least one subcriteria (criterion.criteria) is true.static OperatorBaseRegular expression match.static OperatorBaseStarts with (match case).static OperatorBaseStarts with (match case) another field value (specify fieldName as criterion.value)static OperatorBaseGlob expression start match. -
Method Summary
Modifier and TypeMethodDescriptionRetrieving the Map containing all default operators.static booleanisEndsWithPattern(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 booleanCompare two objects in a style suitable for Advanced Criteria operators.static booleanisEqualToConfiguredValue(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 booleanisMatchingPattern(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 booleanisStartsWithPattern(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 booleanrangeCheck(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 booleanrangeCheckToConfiguredValues(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).
-