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 package org.apache.directory.api.dsmlv2.request;
21
22
23 /**
24 * Object to store the filter. A filter is seen as a tree with a root.
25 *
26 * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
27 */
28 public class AttributeValueAssertionFilter extends Filter
29 {
30 /** The assertion. */
31 private AttributeValueAssertion assertion;
32
33 /** The filter type */
34 private int filterType;
35
36
37 /**
38 * The constructor.
39 *
40 * @param filterType The filter type
41 */
42 public AttributeValueAssertionFilter( int filterType )
43 {
44 this.filterType = filterType;
45 }
46
47
48 /**
49 * Get the assertion
50 *
51 * @return Returns the assertion.
52 */
53 public AttributeValueAssertion getAssertion()
54 {
55 return assertion;
56 }
57
58
59 /**
60 * Set the assertion
61 *
62 * @param assertion The assertion to set.
63 */
64 public void setAssertion( AttributeValueAssertion assertion )
65 {
66 this.assertion = assertion;
67 }
68
69
70 /**
71 * Get the filter type
72 *
73 * @return Returns the filterType.
74 */
75 public int getFilterType()
76 {
77 return filterType;
78 }
79
80
81 /**
82 * Set the filter type
83 *
84 * @param filterType The filterType to set.
85 */
86 public void setFilterType( int filterType )
87 {
88 this.filterType = filterType;
89 }
90
91
92 /**
93 * Return a string compliant with RFC 2254 representing an item filter
94 *
95 * @return The item filter string
96 */
97 public String toString()
98 {
99 return assertion != null ? assertion.toStringRFC2254( filterType ) : "";
100 }
101 }