Package com.github.eikecochu.sqlbuilder
Enum CompareOperator
- java.lang.Object
-
- java.lang.Enum<CompareOperator>
-
- com.github.eikecochu.sqlbuilder.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 BETWEENThe BETWEEN operator.EQUALSThe EQUALS operator.GEThe GREATER EQUALS operator.GTThe GREATER THAN operator.INThe IN operator.IS_NOT_NULLThe IS NOT NULL operator.IS_NULLThe IS NULL operator.LEThe LESSER EQUALS operator.LIKEThe LIKE operator.LTThe LESS THAN operator.NOT_EQUALSThe NOT EQUALS operator.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static CompareOperatorfromString(java.lang.String str)Converts a string to a CompareOperator, if possible.java.lang.Stringstring(QueryOptions options)Transforms this statement into an SQL stringstatic CompareOperatorvalueOf(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.
-
-
-
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 namejava.lang.NullPointerException- if the argument is null
-
string
public java.lang.String string(QueryOptions options)
Description copied from interface:QueryPartTransforms this statement into an 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
-
-