01: /*
02: * Copyright 2006 Luca Garulli (luca.garulli@assetdata.it)
03: *
04: * Licensed under the Apache License, Version 2.0 (the "License");
05: * you may not use this file except in compliance with the License.
06: * You may obtain a copy of the License at
07: *
08: * http://www.apache.org/licenses/LICENSE-2.0
09: *
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:
17: package org.romaframework.aspect.persistence;
18:
19: import org.reverspring.annotations.SpringConstructor;
20:
21: public class QueryByFilterItem {
22:
23: @SpringConstructor(constructorParamsGetters={"getFieldName","getFieldOperator","getFieldValue"})
24: public QueryByFilterItem(String fieldName, String operator,
25: Object value) {
26: this .fieldName = fieldName;
27: this .fieldOperator = operator;
28: this .fieldValue = value;
29: }
30:
31: public String getFieldName() {
32: return fieldName;
33: }
34:
35: public String getFieldOperator() {
36: return fieldOperator;
37: }
38:
39: public Object getFieldValue() {
40: return fieldValue;
41: }
42:
43: @Override
44: public String toString() {
45: if (fieldName == null)
46: return "";
47: StringBuffer buffer = new StringBuffer();
48:
49: buffer.append(fieldName);
50: buffer.append(' ');
51: buffer.append(fieldOperator);
52: buffer.append(' ');
53: buffer.append(fieldValue);
54:
55: return buffer.toString();
56: }
57:
58: private String fieldName;
59: private String fieldOperator;
60: private Object fieldValue;
61: }
|