1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 package org.kuali.rice.core.api.criteria;
17
18 import org.kuali.rice.core.api.CoreConstants;
19 import org.w3c.dom.Element;
20
21 import javax.xml.bind.annotation.XmlAccessType;
22 import javax.xml.bind.annotation.XmlAccessorType;
23 import javax.xml.bind.annotation.XmlAnyElement;
24 import javax.xml.bind.annotation.XmlAttribute;
25 import javax.xml.bind.annotation.XmlElement;
26 import javax.xml.bind.annotation.XmlElements;
27 import javax.xml.bind.annotation.XmlRootElement;
28 import javax.xml.bind.annotation.XmlType;
29
30 import java.util.Collection;
31
32
33
34
35
36
37
38
39
40
41 @XmlRootElement(name = NotEqualPredicate.Constants.ROOT_ELEMENT_NAME)
42 @XmlAccessorType(XmlAccessType.NONE)
43 @XmlType(name = NotEqualPredicate.Constants.TYPE_NAME, propOrder = {
44 CriteriaSupportUtils.PropertyConstants.VALUE,
45 CoreConstants.CommonElements.FUTURE_ELEMENTS
46 })
47 public final class NotEqualPredicate extends AbstractPredicate implements SingleValuedPredicate {
48
49 private static final long serialVersionUID = 7159459561133496549L;
50
51 @XmlAttribute(name = CriteriaSupportUtils.PropertyConstants.PROPERTY_PATH)
52 private final String propertyPath;
53
54 @XmlElements(value = {
55 @XmlElement(name = CriteriaStringValue.Constants.ROOT_ELEMENT_NAME, type = CriteriaStringValue.class, required = true),
56 @XmlElement(name = CriteriaPropertyPathValue.Constants.ROOT_ELEMENT_NAME, type = CriteriaPropertyPathValue.class, required = true),
57 @XmlElement(name = CriteriaDateTimeValue.Constants.ROOT_ELEMENT_NAME, type = CriteriaDateTimeValue.class, required = true),
58 @XmlElement(name = CriteriaDecimalValue.Constants.ROOT_ELEMENT_NAME, type = CriteriaDecimalValue.class, required = true),
59 @XmlElement(name = CriteriaKualiDecimalValue.Constants.ROOT_ELEMENT_NAME, type = CriteriaKualiDecimalValue.class, required = true),
60 @XmlElement(name = CriteriaKualiPercentValue.Constants.ROOT_ELEMENT_NAME, type = CriteriaKualiPercentValue.class, required = true),
61 @XmlElement(name = CriteriaIntegerValue.Constants.ROOT_ELEMENT_NAME, type = CriteriaIntegerValue.class, required = true),
62 @XmlElement(name = CriteriaBooleanValue.Constants.ROOT_ELEMENT_NAME, type = CriteriaIntegerValue.class, required = true)
63 })
64 private final CriteriaValue<?> value;
65
66 @XmlAnyElement
67 private final Collection<Element> _futureElements = null;
68
69
70
71
72 @SuppressWarnings("unused")
73 private NotEqualPredicate() {
74 this.propertyPath = null;
75 this.value = null;
76 }
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95 NotEqualPredicate(String propertyPath, CriteriaValue<?> value) {
96 CriteriaSupportUtils.validateValuedConstruction(getClass(), propertyPath, value);
97 this.propertyPath = propertyPath;
98 this.value = value;
99 }
100
101 @Override
102 public String getPropertyPath() {
103 return propertyPath;
104 }
105
106 @Override
107 public CriteriaValue<?> getValue() {
108 return value;
109 }
110
111
112
113
114 static class Constants {
115 final static String ROOT_ELEMENT_NAME = "notEqual";
116 final static String TYPE_NAME = "NotEqualType";
117 }
118
119 @Override
120 public String toString() {
121 return CriteriaSupportUtils.toString(this);
122 }
123 }