Classes in this File | Line Coverage | Branch Coverage | Complexity | ||||
SearchOperator |
|
| 1.0;1 |
1 | /* | |
2 | * Copyright 2007 The Kuali Foundation | |
3 | * | |
4 | * Licensed under the Educational Community License, Version 1.0 (the "License"); | |
5 | * you may not use this file except in compliance with the License. | |
6 | * You may obtain a copy of the License at | |
7 | * | |
8 | * http://www.opensource.org/licenses/ecl1.php | |
9 | * | |
10 | * Unless required by applicable law or agreed to in writing, software | |
11 | * distributed under the License is distributed on an "AS IS" BASIS, | |
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | |
13 | * See the License for the specific language governing permissions and | |
14 | * limitations under the License. | |
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 | * This class contains a static list of search operators used in rice. | |
24 | * | |
25 | * @author Kuali Rice Team (rice.collab@kuali.org) | |
26 | */ | |
27 | 0 | public enum SearchOperator { |
28 | 0 | AND("&&"), |
29 | 0 | OR("|"), |
30 | 0 | NOT("!"), |
31 | 0 | BETWEEN(".."), |
32 | 0 | NULL("NULL"), |
33 | 0 | LIKE_ONE("?"), |
34 | 0 | LIKE_MANY("*"), |
35 | 0 | LIKE_MANY_P("%"), |
36 | 0 | GREATER_THAN(">"), |
37 | 0 | LESS_THAN("<"), |
38 | 0 | EQUAL("="), |
39 | 0 | GREATER_THAN_EQUAL(">="), |
40 | 0 | LESS_THAN_EQUAL("<="); |
41 | ||
42 | private final String op; | |
43 | 0 | private SearchOperator(String op) { |
44 | 0 | this.op = op; |
45 | 0 | } |
46 | ||
47 | 0 | public static final Collection<SearchOperator> QUERY_CHARACTERS = |
48 | Collections.unmodifiableCollection(Arrays.asList(LIKE_MANY, LIKE_ONE, LIKE_MANY_P, GREATER_THAN, LESS_THAN, BETWEEN, OR, NOT, EQUAL)); | |
49 | ||
50 | 0 | public static final Collection<SearchOperator> RANGE_CHARACTERS = |
51 | Collections.unmodifiableCollection(Arrays.asList(GREATER_THAN_EQUAL, LESS_THAN_EQUAL, GREATER_THAN, LESS_THAN, BETWEEN)); | |
52 | ||
53 | public String op() { | |
54 | 0 | return op; |
55 | } | |
56 | ||
57 | @Override | |
58 | public String toString() { | |
59 | 0 | return op; |
60 | } | |
61 | } |