1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19 package org.mycore.services.fieldquery;
20
21 import org.jdom2.Element;
22 import org.mycore.parsers.bool.MCRCondition;
23
24
25
26
27
28
29
30 public class MCRQueryCondition extends MCRFieldBaseValue implements MCRCondition<Void> {
31
32
33 private String operator;
34
35 public MCRQueryCondition(String fieldName, String operator, String value) {
36 super(fieldName, value);
37 this.operator = operator;
38 }
39
40 public void setOperator(String operator) {
41 this.operator = operator;
42 }
43
44
45 public String getOperator() {
46 return this.operator;
47 }
48
49 @Override
50 public String toString() {
51 return getFieldName() + " " + getOperator() + " \"" + getValue() + "\"";
52 }
53
54 public Element toXML() {
55 Element condition = new Element("condition");
56 condition.setAttribute("field", getFieldName());
57 condition.setAttribute("operator", operator);
58 condition.setAttribute("value", getValue());
59
60 return condition;
61 }
62
63 public boolean evaluate(Void o) {
64
65 throw new UnsupportedOperationException();
66 }
67 }