View Javadoc
1   /*
2    *   Licensed to the Apache Software Foundation (ASF) under one
3    *   or more contributor license agreements.  See the NOTICE file
4    *   distributed with this work for additional information
5    *   regarding copyright ownership.  The ASF licenses this file
6    *   to you under the Apache License, Version 2.0 (the
7    *   "License"); you may not use this file except in compliance
8    *   with the License.  You may obtain a copy of the License at
9    *
10   *     http://www.apache.org/licenses/LICENSE-2.0
11   *
12   *   Unless required by applicable law or agreed to in writing,
13   *   software distributed under the License is distributed on an
14   *   "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15   *   KIND, either express or implied.  See the License for the
16   *   specific language governing permissions and limitations
17   *   under the License.
18   *
19   */
20  
21  package org.apache.directory.ldap.client.api.search;
22  
23  
24  /**
25   * The operators that can be used in a Filter :
26   * <ul>
27   * <li>AND: the '&' operator</li>
28   * <li>OR: the '|' operator</li>
29   * <li>NOT: the '!' operator</li>
30   * <li>EQUAL: the '=' operator</li>
31   * <li>LESS_THAN_OR_EQUAL: the '<=' operator</li>
32   * <li>GREATER_THAN_OR_EQUAL: the '>=' operator</li>
33   * <li>PRESENT: the '=*' operator</li>
34   * <li>APPROXIMATELY_EQUAL: the '~=' operator</li>
35   * </ul>
36   *
37   * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
38   */
39  /* No Qualifier */enum FilterOperator
40  {
41      AND("&"),
42      OR("|"),
43      NOT("!"),
44      APPROXIMATELY_EQUAL("~="),
45      EQUAL("="),
46      PRESENT("=*"),
47      GREATER_THAN_OR_EQUAL(">="),
48      LESS_THAN_OR_EQUAL("<="),
49      EXTENSIBLE_EQUAL(":=");
50  
51      /** The String representing the operator in a FIlter */
52      private String operator;
53  
54  
55      /**
56       * Creates a new instance of FilterOperator.
57       */
58      private FilterOperator( String operator )
59      {
60          this.operator = operator;
61      }
62  
63  
64      /**
65       * @return The String representation of the operator
66       */
67      public String operator()
68      {
69          return operator;
70      }
71  }