Enum Class OperatorType
- All Implemented Interfaces:
Serializable
,Comparable<OperatorType>
,Constable
Operator types
The operator types can be used with the Criteria
object, and they can be used to describe certain criteria.
These can be used as filters when filtering data, or to test a Record
.
- Since:
- 4.0
- Author:
- JBStrap
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>>
-
Enum Constant Summary
Enum ConstantDescriptionAn 'AND' connection between two or more criteria.The operator checks if the examined text ends with the specified text.Checks for equality.The operator checks if the examined value is greater or equal than the specified value.The operator checks if the examined value is greater than the specified value.This operator checks if a value is in the specified list.Checks for null value.The operator checks if the examined value is less or equal than the specified value.The operator checks if the examined value is less than the specified value.The operator checks if the examined text contains the specified text.The operator checks if the examined text doesn't end with the specified text.Examines if the two values are not equal.This operator checks if a value isn't in the specified list.The operator checks if the examined text doesn't contain the specified text.Checks if the value is not null.The operator checks if the examined text doesn't start with the specified text.An 'OR' connection between two or more criteria.The operator checks if the examined text starts with the specified text. -
Method Summary
Modifier and TypeMethodDescriptionstatic OperatorType
Determines the operator type, by specifying its name.Class<?>[]
Class<?>
getType()
boolean
boolean
static OperatorType
Returns the enum constant of this class with the specified name.static OperatorType[]
values()
Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
AND
An 'AND' connection between two or more criteria. Can only be used with a complex criteria -
OR
An 'OR' connection between two or more criteria. Can only be used with a complex criteria -
IN_SET
This operator checks if a value is in the specified list. The values need to be specified in the
List
format. The list has to have the same type, as the examined value.The criterion is met if the value is on the list
-
NOT_IN_SET
This operator checks if a value isn't in the specified list. The values need to be specified in the
List
format. The list has to have the same type, as the examined value.The criterion is met if the value is not on the list
-
IS_NULL
Checks for null value. No value needs to be specified. The criteria is met, if the value isnull
-
NOT_NULL
Checks if the value is not null. No value needs to be specified. The criteria is met, if the value is notnull
-
EQUALS
Checks for equality. The operator can be given any value, which will be checked against the examined value(In case of a JPA based database query,the given value doesn't need to have the same type as the column, any class is accepted that can interpret automatic conversion)
The criteria is met if both values are equal
-
NOT_EQUALS
Examines if the two values are not equal. The operator can be given any value, which will be checked against the examined value(In case of a JPA based database query,the given value doesn't need to have the same type as the column, any class is accepted that can interpret automatic conversion)
The criteria is met if the values are not equal
-
LIKE
The operator checks if the examined text contains the specified text. This operator only works with a string value
The criteria will be met if the examined value is a string, and contains the specified value
-
STARTS_WITH
The operator checks if the examined text starts with the specified text. This operator only works with a string value
The criteria will be met if the examined value is a string, and starts with the specified value
-
ENDS_WITH
The operator checks if the examined text ends with the specified text. This operator only works with a string value
The criteria will be met if the examined value is a string, and ends with the specified value
-
NOT_LIKE
The operator checks if the examined text doesn't contain the specified text. This operator only works with a string value
The criteria will be met if the examined value is a string, and doesn't contain the specified value
-
NOT_STARTS_WITH
The operator checks if the examined text doesn't start with the specified text. This operator only works with a string value
The criteria will be met if the examined value is a string, and doesn't start with the specified value
-
NOT_ENDS_WITH
The operator checks if the examined text doesn't end with the specified text. This operator only works with a string value
The criteria will be met if the examined value is a string, and doesn't end with the specified value
-
GREATER_THAN
-
GREATER_OR_EQUAL
-
LESS_THAN
-
LESS_OR_EQUAL
-
-
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
-
getType
- Returns:
- The operator type
- See Also:
-
getRequiredValueClass
- Returns:
- The required value class
-
getCriteriaBuilderMethodName
- Returns:
- The name of the CriteriaBuilder method, that the operator uses
- See Also:
-
CriteriaBuilder
-
getParamTypes
- Returns:
- The type of the parameters, from the CriteriaBuilder method, that the operator uses
- See Also:
-
CriteriaBuilder
-
getPrefix
- Returns:
- The prefix text
-
getPostfix
- Returns:
- The postfix text
-
isNegated
public boolean isNegated()- Returns:
true
if negated, otherwisefalse
-
fromName
Determines the operator type, by specifying its name. Not case-sensitive- Parameters:
name
- The operator name as a string- Returns:
- The specified operator or
null
, if not found
-
getPredicate
- Returns:
- The predicate or
null
, if not found
-
test
- Parameters:
data
- The data value that will be examinedvalue
- The operator value, that will be used for comparison- Returns:
true
, if they pass the test, otherwisefalse
-