Enum Class RSQLDefaultOperator
- All Implemented Interfaces:
Serializable,Comparable<RSQLDefaultOperator>,Constable
This enum is the public, annotation-friendly view of the default operator
set. Callers typically use these constants in RSQLFilterable
declarations to describe which comparisons are allowed on a field, while the
library internally uses the wrapped ComparisonOperator instances for
parsing, validation, and predicate construction.
The constants are grouped by the kinds of comparisons they enable:
- equality:
EQUAL,NOT_EQUAL - ordering:
GREATER_THAN,GREATER_THAN_OR_EQUAL,LESS_THAN,LESS_THAN_OR_EQUAL - membership:
IN,NOT_IN - null checks:
IS_NULL,NOT_NULL - text:
LIKE,NOT_LIKE,IGNORE_CASE,IGNORE_CASE_LIKE,IGNORE_CASE_NOT_LIKE - range:
BETWEEN,NOT_BETWEEN
Example usage in a DTO or entity contract:
@RSQLFilterable({
RSQLDefaultOperator.EQUAL,
RSQLDefaultOperator.NOT_EQUAL,
RSQLDefaultOperator.IN
})
private String status;
Example request filters that such a declaration would allow:
status==ACTIVE
status!=DELETED
status=in=(ACTIVE,PENDING)
The individual enum constants document the accepted symbolic forms and show representative query examples.
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>> -
Enum Constant Summary
Enum ConstantsEnum ConstantDescriptionRange operator (=between=or=bt=).Strict equality operator (==).Greater than operator (>or=gt=).Greater than or equal to operator (>=or=ge=).Case-insensitive equality operator (=icase=or=ic=).Case-insensitive like operator (=ilike=or=ik=).Case-insensitive not like operator (=inotlike=or=ni=).Set membership operator (=in=).Null check operator (=null=,=isnull=, or=na=).Less than operator (<or=lt=).Less than or equal to operator (<=or=le=).Like operator (=like=or=ke=).Not between operator (=notbetween=or=nb=).Inequality operator (!=).Set non-membership operator (=out=).Not like operator (=notlike=or=nk=).Non-null check operator (=notnull=,=isnotnull=, or=nn=). -
Method Summary
Modifier and TypeMethodDescriptionstatic RSQLDefaultOperatorReturns the enum constant of this class with the specified name.static RSQLDefaultOperator[]values()Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
EQUAL
Strict equality operator (==).Note: This operator enforces strict equality. Wildcards (e.g.,
*) are not supported and will be treated as literal characters.Example:
name=="John Doe"SQL Equivalent:
name = 'John Doe' -
NOT_EQUAL
Inequality operator (!=).Example:
status!="DELETED"SQL Equivalent:
status <> 'DELETED' -
GREATER_THAN
Greater than operator (>or=gt=).Example:
age>18orage=gt=18SQL Equivalent:
age > 18 -
GREATER_THAN_OR_EQUAL
Greater than or equal to operator (>=or=ge=).Example:
price>=100.0orprice=ge=100.0SQL Equivalent:
price >= 100.0 -
LESS_THAN
Less than operator (<or=lt=).Example:
score<50orscore=lt=50SQL Equivalent:
score < 50 -
LESS_THAN_OR_EQUAL
Less than or equal to operator (<=or=le=).Example:
count<=10orcount=le=10SQL Equivalent:
count <= 10 -
IN
Set membership operator (=in=). Expects a list of values.Example:
role=in=(ADMIN,USER)SQL Equivalent:
role IN ('ADMIN', 'USER') -
NOT_IN
Set non-membership operator (=out=). Expects a list of values.Example:
department=out=(HR,FINANCE)SQL Equivalent:
department NOT IN ('HR', 'FINANCE') -
IS_NULL
Null check operator (=null=,=isnull=, or=na=).Example:
middleName=null=ormiddleName=null=trueormiddleName=isnull=trueormiddleName=na=trueSQL Equivalent:
middleName IS NULL -
NOT_NULL
Non-null check operator (=notnull=,=isnotnull=, or=nn=).Example:
email=notnull=oremail=notnull=trueoremail=isnotnull=trueoremail=nn=trueSQL Equivalent:
email IS NOT NULL -
LIKE
Like operator (=like=or=ke=).Example:
description=like="spring"SQL Equivalent:
description LIKE '%spring%' -
NOT_LIKE
Not like operator (=notlike=or=nk=).Example:
title=notlike="Draft"SQL Equivalent:
title NOT LIKE '%Draft%' -
IGNORE_CASE
Case-insensitive equality operator (=icase=or=ic=).Example:
city=icase=londonSQL Equivalent:
LOWER(city) = LOWER('london') -
IGNORE_CASE_LIKE
Case-insensitive like operator (=ilike=or=ik=).Example:
username=ilike="admin"SQL Equivalent:
LOWER(username) LIKE LOWER('%admin%') -
IGNORE_CASE_NOT_LIKE
Case-insensitive not like operator (=inotlike=or=ni=).Example:
tag=inotlike="test"SQL Equivalent:
LOWER(tag) NOT LIKE LOWER('%test%') -
BETWEEN
Range operator (=between=or=bt=). Expects exactly two values.Example:
createdAt=between=(2023-01-01,2023-12-31)SQL Equivalent:
createdAt BETWEEN '2023-01-01' AND '2023-12-31' -
NOT_BETWEEN
Not between operator (=notbetween=or=nb=). Expects exactly two values.Example:
age=notbetween=(18,65)SQL Equivalent:
age NOT BETWEEN 18 AND 65
-
-
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
-