Enum Class CmpOperator
- All Implemented Interfaces:
Serializable,Comparable<CmpOperator>,java.lang.constant.Constable
An enumeration that defines the comparison operations supported by the log
management facility, aka.
log manager.
- Author:
- Patrick Schmidt
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>> -
Enum Constant Summary
Enum ConstantsEnum ConstantDescriptionthe "equals" operatorthe "greater than" operatorthe "greater than or equal" operatorthe "less than" operatorthe "less than or equal" operatorThe "like" operator works like SQL's LIKE operator.A case insensitive version ofLIKE.the "not equals" operatorA negatedLIKEoperator.A case insensitive version ofNOT_LIKE. -
Method Summary
Modifier and TypeMethodDescriptionbooleancanCompare(DataType dataType) Returns whether this comparison operator can generally work on the given data type.booleancanCompare(DataType columnDataType, DataType valueDataType) Returns whether this operator can compare the two given data types.static CmpOperatorgetCmpOperatorForSymbol(String symbol) Returns the comparison operator to which the given symbol belongs ornullif the symbol is not recognised.Returns this comparison operator's associated symbol.static CmpOperatorReturns the enum constant of this class with the specified name.static CmpOperator[]values()Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
EQUAL
the "equals" operator -
NOT_EQUAL
the "not equals" operator -
GREATER_THAN
the "greater than" operator -
GREATER_THAN_OR_EQUAL
the "greater than or equal" operator -
LESS_THAN
the "less than" operator -
LESS_THAN_OR_EQUAL
the "less than or equal" operator -
LIKE
The "like" operator works like SQL's LIKE operator._is a placeholder for exactly one character;%is a placeholder for an arbitrary number of characters (even zero). Only works on strings. -
NOT_LIKE
A negatedLIKEoperator. Only works on strings. -
LIKE_IGNORECASE
-
NOT_LIKE_IGNORECASE
-
-
Method Details
-
values
Returns an array containing the constants of this enum class, in the order they are declared.- Returns:
- an array containing the constants of this enum class, in the order they are declared
-
valueOf
Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (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:
IllegalArgumentException- if this enum class has no constant with the specified nameNullPointerException- if the argument is null
-
getSymbol
Returns this comparison operator's associated symbol.- Returns:
- this comparison operator's associated symbol
-
getCmpOperatorForSymbol
Returns the comparison operator to which the given symbol belongs ornullif the symbol is not recognised.- Parameters:
symbol- the symbol for which to find the comparison operator- Returns:
- the comparison operator for this symbol or
null
-
canCompare
Returns whether this comparison operator can generally work on the given data type. If it can, this at least guarantees that it can compare two values of this same type. If the parameter isnullthis method will determine if the operator can deal withnullvalues (at the time of writing, onlyEQUALandNOT_EQUALcan do that).- Parameters:
dataType- the data type to be tested- Returns:
- whether this comparison operator can generally work on the given data type
-
canCompare
Returns whether this operator can compare the two given data types. The left-hand data type is the data type of a column and must therefore never benull. The right-hand data type is the data type of the value ornullif the value itself isnull. At the time of writing, onlyEQUALandNOT_EQUALcan compare anull-value to the value of a column.- Parameters:
columnDataType- the left-hand data type (which should be the column's data type)valueDataType- the right-hand data type (which should be the value object's data type ornull)- Returns:
- whether this operator can compare the two given data types
-