com.isomorphic.criteria

## Class DefaultOperators

- java.lang.Object
- - com.isomorphic.criteria.DefaultOperators

-     public class DefaultOperators
      extends java.lang.Object

  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 `DefaultOperators.getDefaultOperatorMap()` method.

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `static OperatorBase` | `And` All subcriteria (criterion.criteria) are true.
    `static OperatorBase` | `Between` Shortcut for greaterThan + lessThan + and.
    `static OperatorBase` | `BetweenInclusive` Shortcut for greaterOrEqual + lessOrEqual + and.
    `static OperatorBase` | `Contains` Contains as sub-string (match case).
    `static OperatorBase` | `ContainsField` Contains as sub-string (match case) another field value (specify fieldName as criterion.value).
    `static OperatorBase` | `EndsWith` Ends with (match case).
    `static OperatorBase` | `EndsWithField` Ends with (match case) another field value (specify fieldName as criterion.value).
    `static OperatorBase` | `EndsWithPattern` Glob expression ends match.
    `static OperatorBase` | `Equals` Exactly equal to.
    `static OperatorBase` | `EqualsField` Matches another field (specify fieldName as criterion.value).
    `static OperatorBase` | `GreaterOrEqual` Greater than or equal to.
    `static OperatorBase` | `GreaterOrEqualField` Greater than or equal to another field (specify fieldName as criterion.value).
    `static OperatorBase` | `GreaterThan` Greater than.
    `static OperatorBase` | `GreaterThanField` Greater than another field (specify fieldName as criterion.value).
    `static OperatorBase` | `IBetween` Shortcut for greaterThan + lessThan + and (case insensitive)
    `static OperatorBase` | `IBetweenInclusive` Shortcut for greaterOrEqual + lessOrEqual + and (case insensitive)
    `static OperatorBase` | `IContains` Contains as sub-string (case insensitive).
    `static OperatorBase` | `IContainsField` Contains as sub-string another field value (specify fieldName as criterion.value).
    `static OperatorBase` | `IEndsWith` Ends with (case insensitive).
    `static OperatorBase` | `IEndsWithField` Ends with another field value (specify fieldName as criterion.value).
    `static OperatorBase` | `IEndsWithPattern` Glob expression ends match.
    `static OperatorBase` | `IEquals` exactly equal to, if case is disregarded.
    `static OperatorBase` | `IEqualsField` Matches another field ignoring case (specify fieldName as criterion.value).
    `static OperatorBase` | `IMatchesPattern` Glob expression match (case insensitive).
    `static OperatorBase` | `INotContains` Does not contain as sub-string (case insensitive).
    `static OperatorBase` | `INotContainsField` Does not contain a sub-string of another field value (specify fieldName as criterion.value).
    `static OperatorBase` | `INotEndsWith` Does not end with (case insensitive).
    `static OperatorBase` | `INotEndsWithField` Does not end with another field value (specify fieldName as criterion.value).
    `static OperatorBase` | `INotEqual` Not equal to, if case is disregarded.
    `static OperatorBase` | `INotEqualField` Does not match another field ignoring case (specify fieldName as criterion.value).
    `static OperatorBase` | `INotStartsWith` Does not start with (case insensitive).
    `static OperatorBase` | `INotStartsWithField` Does not start with another field value (specify fieldName as criterion.value)
    `static OperatorBase` | `InSet` Value is in a set of values.
    `static OperatorBase` | `Iregexp` Regular expression match (case insensitive).
    `static OperatorBase` | `IsNull` Value is null.
    `static OperatorBase` | `IStartsWith` Starts with (case insensitive).
    `static OperatorBase` | `IStartsWithField` Starts with another field value (specify fieldName as criterion.value)
    `static OperatorBase` | `IStartsWithPattern` Glob expression start match.
    `static OperatorBase` | `LessOrEqual` Less than or equal to.
    `static OperatorBase` | `LessOrEqualField` Less than or equal to another field (specify fieldName as criterion.value).
    `static OperatorBase` | `LessThan` Less than.
    `static OperatorBase` | `LessThanField` Less than another field (specify fieldName as criterion.value).
    `static OperatorBase` | `MatchesPattern` Glob expression match.
    `static OperatorBase` | `Not` All subcriteria (criterion.criteria) are false.
    `static OperatorBase` | `NotContains` Does not contain as sub-string (match case).
    `static OperatorBase` | `NotContainsField` Does not contain a sub-string (match case) of another field value (specify fieldName as criterion.value).
    `static OperatorBase` | `NotEndsWith` Does not end with (match case).
    `static OperatorBase` | `NotEndsWithField` Does not end with (match case) another field value (specify fieldName as criterion.value).
    `static OperatorBase` | `NotEqual` Not equal to.
    `static OperatorBase` | `NotEqualField` Does not match another field (specify fieldName as criterion.value).
    `static OperatorBase` | `NotInSet` Value is not in a set of values.
    `static OperatorBase` | `NotNull` Value is non-null.
    `static OperatorBase` | `NotStartsWith` Does not start with (match case).
    `static OperatorBase` | `NotStartsWithField` Does not start with (match case) another field value (specify fieldName as criterion.value)
    `static OperatorBase` | `Or` At least one subcriteria (criterion.criteria) is true.
    `static OperatorBase` | `Regexp` Regular expression match.
    `static OperatorBase` | `StartsWith` Starts with (match case).
    `static OperatorBase` | `StartsWithField` Starts with (match case) another field value (specify fieldName as criterion.value)
    `static OperatorBase` | `StartsWithPattern` Glob expression start match.

  - ### Method Summary

    All Methods Static Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `static java.util.Map` | `getDefaultOperatorMap()` Retrieving the Map containing all default operators.
    `static boolean` | `isEndsWithPattern(java.lang.String value, java.lang.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` | `isEqual(java.lang.Object value, java.lang.Object operand)` Compare two objects in a style suitable for Advanced Criteria operators.
    `static boolean` | `isEqualToConfiguredValue(java.lang.Object value, java.lang.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(java.lang.String value, java.lang.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(java.lang.String value, java.lang.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(java.lang.Object value, java.lang.Object lower, java.lang.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(java.lang.Object value, java.lang.String lower, java.lang.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 Detail

    - #### Equals

          public static OperatorBase Equals

      Exactly equal to.

    - #### NotEqual

          public static OperatorBase NotEqual

      Not equal to.

    - #### IEquals

          public static OperatorBase IEquals

      exactly equal to, if case is disregarded.

    - #### INotEqual

          public static OperatorBase INotEqual

      Not equal to, if case is disregarded.

    - #### GreaterThan

          public static OperatorBase GreaterThan

      Greater than.

    - #### LessThan

          public static OperatorBase LessThan

      Less than.

    - #### GreaterOrEqual

          public static OperatorBase GreaterOrEqual

      Greater than or equal to.

    - #### LessOrEqual

          public static OperatorBase LessOrEqual

      Less than or equal to.

    - #### Between

          public static OperatorBase Between

      Shortcut for greaterThan + lessThan + and.

    - #### IBetween

          public static OperatorBase IBetween

      Shortcut for greaterThan + lessThan + and (case insensitive)

    - #### BetweenInclusive

          public static OperatorBase BetweenInclusive

      Shortcut for greaterOrEqual + lessOrEqual + and.

    - #### IBetweenInclusive

          public static OperatorBase IBetweenInclusive

      Shortcut for greaterOrEqual + lessOrEqual + and (case insensitive)

    - #### IContains

          public static OperatorBase IContains

      Contains as sub-string (case insensitive).

    - #### IStartsWith

          public static OperatorBase IStartsWith

      Starts with (case insensitive).

    - #### IEndsWith

          public static OperatorBase IEndsWith

      Ends with (case insensitive).

    - #### Contains

          public static OperatorBase Contains

      Contains as sub-string (match case).

    - #### StartsWith

          public static OperatorBase StartsWith

      Starts with (match case).

    - #### EndsWith

          public static OperatorBase EndsWith

      Ends with (match case).

    - #### INotContains

          public static OperatorBase INotContains

      Does not contain as sub-string (case insensitive).

    - #### INotStartsWith

          public static OperatorBase INotStartsWith

      Does not start with (case insensitive).

    - #### INotEndsWith

          public static OperatorBase INotEndsWith

      Does not end with (case insensitive).

    - #### NotContains

          public static OperatorBase NotContains

      Does not contain as sub-string (match case).

    - #### NotStartsWith

          public static OperatorBase NotStartsWith

      Does not start with (match case).

    - #### NotEndsWith

          public static OperatorBase NotEndsWith

      Does not end with (match case).

    - #### IsNull

          public static OperatorBase IsNull

      Value is null.

    - #### NotNull

          public static OperatorBase NotNull

      Value is non-null.

    - #### Regexp

          public static OperatorBase Regexp

      Regular expression match.

    - #### Iregexp

          public static OperatorBase Iregexp

      Regular expression match (case insensitive).

    - #### StartsWithPattern

          public static OperatorBase StartsWithPattern

      Glob expression start match. Multi wildcard character allowed is '*' Single wildcard characters allowed are '%' and '?'

    - #### IStartsWithPattern

          public static OperatorBase IStartsWithPattern

      Glob expression start match. Multi wildcard character allowed is '*' Single wildcard characters allowed are '%' and '?'

    - #### EndsWithPattern

          public static OperatorBase EndsWithPattern

      Glob expression ends match. Multi wildcard character allowed is '*' Single wildcard characters allowed are '%' and '?'

    - #### IEndsWithPattern

          public static OperatorBase IEndsWithPattern

      Glob expression ends match. Multi wildcard character allowed is '*' Single wildcard characters allowed are '%' and '?'

    - #### MatchesPattern

          public static OperatorBase MatchesPattern

      Glob expression match. Multi wildcard character allowed is '*' Single wildcard characters allowed are '%' and '?'

    - #### IMatchesPattern

          public static OperatorBase IMatchesPattern

      Glob expression match (case insensitive). Multi wildcard character allowed is '*' Single wildcard characters allowed are '%' and '?'

    - #### InSet

          public static OperatorBase InSet

      Value is in a set of values.

    - #### NotInSet

          public static OperatorBase NotInSet

      Value is not in a set of values.

    - #### EqualsField

          public static OperatorBase EqualsField

      Matches another field (specify fieldName as criterion.value).

    - #### IEqualsField

          public static OperatorBase IEqualsField

      Matches another field ignoring case (specify fieldName as criterion.value). This relies on the field values being strings.

    - #### NotEqualField

          public static OperatorBase NotEqualField

      Does not match another field (specify fieldName as criterion.value).

    - #### INotEqualField

          public static OperatorBase INotEqualField

      Does not match another field ignoring case (specify fieldName as criterion.value). This relies on the field values being strings.

    - #### And

          public static OperatorBase And

      All subcriteria (criterion.criteria) are true.

    - #### Not

          public static OperatorBase Not

      All subcriteria (criterion.criteria) are false.

    - #### Or

          public static OperatorBase Or

      At least one subcriteria (criterion.criteria) is true.

    - #### GreaterThanField

          public static OperatorBase GreaterThanField

      Greater than another field (specify fieldName as criterion.value).

    - #### LessThanField

          public static OperatorBase LessThanField

      Less than another field (specify fieldName as criterion.value).

    - #### GreaterOrEqualField

          public static OperatorBase GreaterOrEqualField

      Greater than or equal to another field (specify fieldName as criterion.value).

    - #### LessOrEqualField

          public static OperatorBase LessOrEqualField

      Less than or equal to another field (specify fieldName as criterion.value).

    - #### ContainsField

          public static OperatorBase ContainsField

      Contains as sub-string (match case) another field value (specify fieldName as criterion.value).

    - #### IContainsField

          public static OperatorBase IContainsField

      Contains as sub-string another field value (specify fieldName as criterion.value).

    - #### NotContainsField

          public static OperatorBase NotContainsField

      Does not contain a sub-string (match case) of another field value (specify fieldName as criterion.value).

    - #### INotContainsField

          public static OperatorBase INotContainsField

      Does not contain a sub-string of another field value (specify fieldName as criterion.value).

    - #### StartsWithField

          public static OperatorBase StartsWithField

      Starts with (match case) another field value (specify fieldName as criterion.value)

    - #### IStartsWithField

          public static OperatorBase IStartsWithField

      Starts with another field value (specify fieldName as criterion.value)

    - #### NotStartsWithField

          public static OperatorBase NotStartsWithField

      Does not start with (match case) another field value (specify fieldName as criterion.value)

    - #### INotStartsWithField

          public static OperatorBase INotStartsWithField

      Does not start with another field value (specify fieldName as criterion.value)

    - #### EndsWithField

          public static OperatorBase EndsWithField

      Ends with (match case) another field value (specify fieldName as criterion.value).

    - #### IEndsWithField

          public static OperatorBase IEndsWithField

      Ends with another field value (specify fieldName as criterion.value).

    - #### NotEndsWithField

          public static OperatorBase NotEndsWithField

      Does not end with (match case) another field value (specify fieldName as criterion.value).

    - #### INotEndsWithField

          public static OperatorBase INotEndsWithField

      Does not end with another field value (specify fieldName as criterion.value).

  - ### Method Detail

    - #### isEqualToConfiguredValue

          public static boolean isEqualToConfiguredValue(java.lang.Object value,
                                                         java.lang.String operand)
                                                  throws java.lang.Exception

      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:
        `java.lang.Exception`

    - #### isEqual

          public static boolean isEqual(java.lang.Object value,
                                        java.lang.Object operand)
                                 throws java.lang.Exception

      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:
        `java.lang.Exception`

    - #### rangeCheckToConfiguredValues

          public static boolean rangeCheckToConfiguredValues(java.lang.Object value,
                                                             java.lang.String lower,
                                                             java.lang.String upper,
                                                             boolean inclusive,
                                                             boolean caseInsensitive)
                                                      throws java.lang.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:
        `java.lang.Exception`

    - #### rangeCheck

          public static boolean rangeCheck(java.lang.Object value,
                                           java.lang.Object lower,
                                           java.lang.Object upper,
                                           boolean inclusive,
                                           boolean caseInsensitive)
                                    throws java.lang.Exception

      Evaluates: "lower (< <=) value (< <=) upper", where lower, value, and upper are presumed to be objects of (nearly) the same type.
      Throws:
        `java.lang.Exception`

    - #### isMatchingPattern

          public static boolean isMatchingPattern(java.lang.String value,
                                                  java.lang.String matchesPattern,
                                                  boolean ignoreCase)
                                           throws java.lang.Exception

      Checks to see if the value matches the pattern described allowing for multi wildcard character '*' and single wildcard characters '%' and '?'
      Throws:
        `java.lang.Exception`

    - #### isStartsWithPattern

          public static boolean isStartsWithPattern(java.lang.String value,
                                                    java.lang.String matchesPattern,
                                                    boolean ignoreCase)
                                             throws java.lang.Exception

      Checks to see if the value starts with the pattern described allowing for multi wildcard character '*' and single wildcard characters '%' and '?'
      Throws:
        `java.lang.Exception`

    - #### isEndsWithPattern

          public static boolean isEndsWithPattern(java.lang.String value,
                                                  java.lang.String matchesPattern,
                                                  boolean ignoreCase)
                                           throws java.lang.Exception

      Checks to see if the value ends with the pattern described allowing for multi wildcard character '*' and single wildcard characters '%' and '?'
      Throws:
        `java.lang.Exception`

    - #### getDefaultOperatorMap

          public static java.util.Map getDefaultOperatorMap()

      Retrieving the Map containing all default operators.
      Returns:
        all default operators as map(id->operator).