Enum Class RSQLDefaultOperator

java.lang.Object
java.lang.Enum<RSQLDefaultOperator>
in.co.akshitbansal.springwebquery.operator.RSQLDefaultOperator
All Implemented Interfaces:
Serializable, Comparable<RSQLDefaultOperator>, Constable

public enum RSQLDefaultOperator extends Enum<RSQLDefaultOperator>
Enumerates the built-in comparison operators exposed by the library.

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:

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.

  • Enum Constant Details

    • EQUAL

      public static final RSQLDefaultOperator 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

      public static final RSQLDefaultOperator NOT_EQUAL
      Inequality operator (!=).

      Example: status!="DELETED"

      SQL Equivalent: status <> 'DELETED'

    • GREATER_THAN

      public static final RSQLDefaultOperator GREATER_THAN
      Greater than operator (> or =gt=).

      Example: age>18 or age=gt=18

      SQL Equivalent: age > 18

    • GREATER_THAN_OR_EQUAL

      public static final RSQLDefaultOperator GREATER_THAN_OR_EQUAL
      Greater than or equal to operator (>= or =ge=).

      Example: price>=100.0 or price=ge=100.0

      SQL Equivalent: price >= 100.0

    • LESS_THAN

      public static final RSQLDefaultOperator LESS_THAN
      Less than operator (< or =lt=).

      Example: score<50 or score=lt=50

      SQL Equivalent: score < 50

    • LESS_THAN_OR_EQUAL

      public static final RSQLDefaultOperator LESS_THAN_OR_EQUAL
      Less than or equal to operator (<= or =le=).

      Example: count<=10 or count=le=10

      SQL Equivalent: count <= 10

    • IN

      public static final RSQLDefaultOperator IN
      Set membership operator (=in=). Expects a list of values.

      Example: role=in=(ADMIN,USER)

      SQL Equivalent: role IN ('ADMIN', 'USER')

    • NOT_IN

      public static final RSQLDefaultOperator 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

      public static final RSQLDefaultOperator IS_NULL
      Null check operator (=null=, =isnull=, or =na=).

      Example: middleName=null= or middleName=null=true or middleName=isnull=true or middleName=na=true

      SQL Equivalent: middleName IS NULL

    • NOT_NULL

      public static final RSQLDefaultOperator NOT_NULL
      Non-null check operator (=notnull=, =isnotnull=, or =nn=).

      Example: email=notnull= or email=notnull=true or email=isnotnull=true or email=nn=true

      SQL Equivalent: email IS NOT NULL

    • LIKE

      public static final RSQLDefaultOperator LIKE
      Like operator (=like= or =ke=).

      Example: description=like="spring"

      SQL Equivalent: description LIKE '%spring%'

    • NOT_LIKE

      public static final RSQLDefaultOperator NOT_LIKE
      Not like operator (=notlike= or =nk=).

      Example: title=notlike="Draft"

      SQL Equivalent: title NOT LIKE '%Draft%'

    • IGNORE_CASE

      public static final RSQLDefaultOperator IGNORE_CASE
      Case-insensitive equality operator (=icase= or =ic=).

      Example: city=icase=london

      SQL Equivalent: LOWER(city) = LOWER('london')

    • IGNORE_CASE_LIKE

      public static final RSQLDefaultOperator 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

      public static final RSQLDefaultOperator 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

      public static final RSQLDefaultOperator 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

      public static final RSQLDefaultOperator 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

      public static RSQLDefaultOperator[] 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

      public static RSQLDefaultOperator valueOf(String name)
      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 name
      NullPointerException - if the argument is null