1 | |
|
2 | |
|
3 | |
|
4 | |
|
5 | |
|
6 | |
|
7 | |
|
8 | |
|
9 | |
|
10 | |
|
11 | |
|
12 | |
|
13 | |
|
14 | |
|
15 | |
|
16 | |
package org.kuali.rice.core.api.search; |
17 | |
|
18 | |
import java.util.Arrays; |
19 | |
import java.util.Collection; |
20 | |
import java.util.Collections; |
21 | |
|
22 | |
|
23 | |
|
24 | |
|
25 | |
|
26 | |
|
27 | 0 | public enum SearchOperator { |
28 | 0 | AND("&&"), |
29 | 0 | OR("|"), |
30 | 0 | NOT("!"), |
31 | 0 | BETWEEN(".."), |
32 | 0 | BETWEEN_EXCLUSIVE_UPPER("..."), |
33 | 0 | NULL("NULL"), |
34 | 0 | NOT_NULL("!NULL"), |
35 | 0 | LIKE_ONE("?"), |
36 | 0 | LIKE_MANY("*"), |
37 | 0 | LIKE_MANY_P("%"), |
38 | 0 | GREATER_THAN(">"), |
39 | 0 | LESS_THAN("<"), |
40 | 0 | EQUAL("="), |
41 | 0 | GREATER_THAN_EQUAL(">="), |
42 | 0 | LESS_THAN_EQUAL("<="); |
43 | |
|
44 | |
private final String op; |
45 | 0 | private SearchOperator(String op) { |
46 | 0 | this.op = op; |
47 | 0 | } |
48 | |
|
49 | 0 | public static final Collection<SearchOperator> QUERY_CHARACTERS = |
50 | |
Collections.unmodifiableCollection(Arrays.asList(LIKE_MANY, LIKE_ONE, LIKE_MANY_P, GREATER_THAN, LESS_THAN, BETWEEN, BETWEEN_EXCLUSIVE_UPPER, OR, NOT, EQUAL)); |
51 | |
|
52 | 0 | public static final Collection<SearchOperator> RANGE_CHARACTERS = |
53 | |
Collections.unmodifiableCollection(Arrays.asList(GREATER_THAN_EQUAL, LESS_THAN_EQUAL, GREATER_THAN, LESS_THAN, BETWEEN, BETWEEN_EXCLUSIVE_UPPER)); |
54 | |
|
55 | |
public String op() { |
56 | 0 | return op; |
57 | |
} |
58 | |
|
59 | |
@Override |
60 | |
public String toString() { |
61 | 0 | return op; |
62 | |
} |
63 | |
} |