Class Operator

  • All Implemented Interfaces:
    java.io.Serializable

    public final class Operator
    extends FlexibleSearchTranslatable
    Class represents an Operator; is used with all types of GenericConditions.
    See Also:
    Serialized Form
    • Field Detail

      • EQUAL

        public static final Operator EQUAL
        code: 1
        symbol: =
        codestring: equal
      • UNEQUAL

        public static final Operator UNEQUAL
        code: 2
        symbol: <>
        codestring: <>
      • LIKE

        public static final Operator LIKE
        code: 3
        symbol: LIKE
        codestring: like
      • STARTS_WITH

        public static final Operator STARTS_WITH
        code: 4
        symbol: LIKE
        codestring: starts with
      • ENDS_WITH

        public static final Operator ENDS_WITH
        code: 5
        symbol: LIKE
        codestring: ends with
      • CONTAINS

        public static final Operator CONTAINS
        code: 6
        symbol: LIKE
        codestring: contains
      • GREATER

        public static final Operator GREATER
        code: 7
        symbol: >
        codestring: >
      • LESS

        public static final Operator LESS
        code: 8
        symbol: <
        codestring: <
      • GREATER_OR_EQUAL

        public static final Operator GREATER_OR_EQUAL
        code: 9
        symbol: >=
        codestring: >=
      • LESS_OR_EQUAL

        public static final Operator LESS_OR_EQUAL
        code: 10
        symbol: <=
        codestring: <=
      • IS_NOT_NULL

        public static final Operator IS_NOT_NULL
        code: 11
        symbol: IS NOT NULL
        codestring: is not null
      • IS_NULL

        public static final Operator IS_NULL
        code: 12
        symbol: IS NULL
        codestring: is null
      • IN

        public static final Operator IN
        code: 13
        symbol: IN
        codestring: in
      • NOT_IN

        public static final Operator NOT_IN
        code: 14
        symbol: NOT IN
        codestring: not in
      • EXISTS

        public static final Operator EXISTS
        code: 15
        symbol: EXISTS
        codestring: exists
      • NOT_EXISTS

        public static final Operator NOT_EXISTS
        code: 16
        symbol: NOT_EXISTS
        codestring: not exists
      • AND

        public static final Operator AND
        code: 17
        symbol: AND
        codestring: and
      • OR

        public static final Operator OR
        code: 18
        symbol: OR
        codestring: or
      • NOT_LIKE

        public static final Operator NOT_LIKE
        code: 19
        symbol: NOT_LIKE
        codestring: not like
      • DEFAULT

        public static final Operator DEFAULT
        The DEFAULT Operator is Operator.EQUAL
    • Constructor Detail

      • Operator

        protected Operator​(int code,
                           java.lang.String sql_str,
                           java.lang.String code_str)
        Constructor. Creates a new Operator with the code, the sql string (like 'IS NULL')
        Parameters:
        code - code of the Operator, int value between 1 and 18
        sql_str - the sql equivalent of this operator, like 'NOT IN' or 'AND'
        code_str - the code string
    • Method Detail

      • getCode

        public int getCode()
        Returns:
        the code.
      • getStringCode

        public java.lang.String getStringCode()
        Returns:
        the string code, like '=' or 'not exists'
      • getSQLString

        public java.lang.String getSQLString()
        Returns:
        the SQL query like 'NOT' or 'NOT_EXISTS'
      • getOperatorByStringCode

        public static Operator getOperatorByStringCode​(java.lang.String str_code)
        Parameters:
        str_code - the string code
        Returns:
        a new Instance of the Operator which match the given string code. Please have a look at the constants of this class.
      • getOperatorByCode

        public static Operator getOperatorByCode​(int code)
        Parameters:
        code - the code of the Operator (at the moment: 1 - 18). Please have a look at the constants of this class.
        Returns:
        new Instance of the Operator which match the given code (int value from 1 to 18)
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object
      • equals

        public boolean equals​(java.lang.Object arg0)
        Overrides:
        equals in class java.lang.Object
        Returns:
        true if the Operators are equal (compared by Operator code)
        See Also:
        Object.equals(java.lang.Object)
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class java.lang.Object
      • allowsCollection

        public boolean allowsCollection()
      • isUnary

        public boolean isUnary()
      • isTranslatableToPolyglotDialect

        public boolean isTranslatableToPolyglotDialect()