Class SearchOperatorSet
SearchOperators that governs which $-operators the parser
recognizes.
standard() is the built-in set (the confirmed operators with their arity and per-type applicability).
Applications extend it with with(SearchOperator) (add a custom operator to a copy) or build a bespoke set
with of(SearchOperator...). A context uses one set as its default and may hold a per-column map; a
per-column set replaces the default for that column rather than merging with it.
Juneau uses the spellings $prefix and $blank as first-class names; there are deliberately no
$starts/$empty aliases.
Case-insensitive names
Lookup (get(String), contains(String), without(String)) is case-insensitive:
$EQ, $Eq and $eq all resolve to the same operator. of(SearchOperator...) rejects two
operators whose names differ only in case; with(SearchOperator) replaces a same-name-ignoring-case
operator, the same way it replaces an exact-name one. operators() and get(String) always expose
the operator's own canonical (registered) name, never the casing a caller looked it up with.
Example:
- Since:
- 10.0.0
-
Method Summary
Modifier and TypeMethodDescriptionbooleanWhether this set contains an operator with the specified name, ignoring case.forType(SearchType type) The operators in this set offered for the specified value type, including the combinators (which apply to every type).Looks up an operator by name, ignoring case.static SearchOperatorSetof(SearchOperator... operators) Builds a set from exactly the specified operators (no built-ins are implied).All operators in this set, in canonical order.static SearchOperatorSetstandard()The built-in operator set.with(SearchOperator op) Returns a copy of this set with the specified operator added, replacing a same-name-ignoring-case operator if one is already present.Returns a copy of this set without the named operator.
-
Method Details
-
standard
The built-in operator set.- Returns:
- The standard set, never
null .
-
of
Builds a set from exactly the specified operators (no built-ins are implied).- Parameters:
operators- The operators, in the order to expose them. Must not benull ; names must be unique ignoring case.- Returns:
- A new set.
-
with
Returns a copy of this set with the specified operator added, replacing a same-name-ignoring-case operator if one is already present.- Parameters:
op- The operator to add. Must not benull .- Returns:
- A new set; this set is unchanged.
-
without
Returns a copy of this set without the named operator.- Parameters:
name- The operator name (for example"$regex"), matched ignoring case. Can benull .- Returns:
- A new set, or this set if it has no operator with that name.
-
get
Looks up an operator by name, ignoring case.- Parameters:
name- The operator name, including the leading$(e.g."$eq"or"$EQ"). Can benull .- Returns:
- The operator (with its canonical, registered-case name), or
null if not in this set.
-
contains
Whether this set contains an operator with the specified name, ignoring case.- Parameters:
name- The operator name. Can benull .- Returns:
true if present.
-
operators
All operators in this set, in canonical order.- Returns:
- An unmodifiable list.
-
forType
The operators in this set offered for the specified value type, including the combinators (which apply to every type).- Parameters:
type- The column value type. Can benull (yields an empty list).- Returns:
- An unmodifiable list of applicable operators, in canonical order.
-