Enum CompareOperator

  • All Implemented Interfaces:
    QueryPart, java.io.Serializable, java.lang.Comparable<CompareOperator>

    public enum CompareOperator
    extends java.lang.Enum<CompareOperator>
    implements QueryPart
    The CompareOperator represents valid comparation operations between SQL expressions, for example in the WHERE statement, or the JOIN statement.
    • Enum Constant Summary

      Enum Constants 
      Enum Constant Description
      BETWEEN
      The BETWEEN operator.
      EQUALS
      The EQUALS operator.
      GE
      The GREATER EQUALS operator.
      GT
      The GREATER THAN operator.
      IN
      The IN operator.
      IS_NOT_NULL
      The IS NOT NULL operator.
      IS_NULL
      The IS NULL operator.
      LE
      The LESSER EQUALS operator.
      LIKE
      The LIKE operator.
      LT
      The LESS THAN operator.
      NOT_EQUALS
      The NOT EQUALS operator.
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      static CompareOperator fromString​(java.lang.String str)
      Converts a string to a CompareOperator, if possible.
      java.lang.String string​(QueryOptions options)
      Transforms this statement into an SQL string
      static CompareOperator valueOf​(java.lang.String name)
      Returns the enum constant of this type with the specified name.
      static CompareOperator[] values()
      Returns an array containing the constants of this enum type, in the order they are declared.
      • Methods inherited from class java.lang.Enum

        clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
      • Methods inherited from class java.lang.Object

        getClass, notify, notifyAll, wait, wait, wait
      • Methods inherited from interface com.github.eikecochu.sqlbuilder.QueryPart

        string
    • Enum Constant Detail

      • EQUALS

        public static final CompareOperator EQUALS
        The EQUALS operator. Compares for equality.
      • NOT_EQUALS

        public static final CompareOperator NOT_EQUALS
        The NOT EQUALS operator. Compares for inequality.
      • LIKE

        public static final CompareOperator LIKE
        The LIKE operator. Compares to matching patterns with the % wildcard.
      • IN

        public static final CompareOperator IN
        The IN operator. Compares to lists of values.
      • IS_NULL

        public static final CompareOperator IS_NULL
        The IS NULL operator. Compares to NULL
      • IS_NOT_NULL

        public static final CompareOperator IS_NOT_NULL
        The IS NOT NULL operator. Compares to NOT NULL
      • GE

        public static final CompareOperator GE
        The GREATER EQUALS operator. Compares to greater or equal.
      • GT

        public static final CompareOperator GT
        The GREATER THAN operator. Compares to greater.
      • LE

        public static final CompareOperator LE
        The LESSER EQUALS operator. Compares to less or equal.
      • LT

        public static final CompareOperator LT
        The LESS THAN operator. Compares to less.
      • BETWEEN

        public static final CompareOperator BETWEEN
        The BETWEEN operator. Compares to be in between two values.
    • Method Detail

      • values

        public static CompareOperator[] values()
        Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:
        for (CompareOperator c : CompareOperator.values())
            System.out.println(c);
        
        Returns:
        an array containing the constants of this enum type, in the order they are declared
      • valueOf

        public static CompareOperator valueOf​(java.lang.String name)
        Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)
        Parameters:
        name - the name of the enum constant to be returned.
        Returns:
        the enum constant with the specified name
        Throws:
        java.lang.IllegalArgumentException - if this enum type has no constant with the specified name
        java.lang.NullPointerException - if the argument is null
      • string

        public java.lang.String string​(QueryOptions options)
        Description copied from interface: QueryPart
        Transforms this statement into an SQL string
        Specified by:
        string in interface QueryPart
        Parameters:
        options - The QueryOptions to apply for transformation
        Returns:
        The created SQL string
      • fromString

        public static CompareOperator fromString​(java.lang.String str)
        Converts a string to a CompareOperator, if possible.
        Parameters:
        str - The operator string
        Returns:
        the found CompareOperator