Coverage Report - org.kuali.rice.core.api.search.SearchOperator
 
Classes in this File Line Coverage Branch Coverage Complexity
SearchOperator
0%
0/23
N/A
1
 
 1  
 /**
 2  
  * Copyright 2005-2011 The Kuali Foundation
 3  
  *
 4  
  * Licensed under the Educational Community License, Version 2.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/ecl2.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
     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  
 }