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.apache.commons.lang.builder.EqualsBuilder;
19 import org.apache.commons.lang.builder.HashCodeBuilder;
20 import org.apache.commons.lang.builder.ToStringBuilder;
21
22 import javax.xml.bind.annotation.XmlAccessType;
23 import javax.xml.bind.annotation.XmlAccessorType;
24 import javax.xml.bind.annotation.XmlRootElement;
25 import javax.xml.bind.annotation.XmlType;
26 import javax.xml.bind.annotation.XmlValue;
27
28
29
30
31
32
33
34
35 @XmlRootElement(name = CriteriaBooleanValue.Constants.ROOT_ELEMENT_NAME)
36 @XmlAccessorType(XmlAccessType.NONE)
37 @XmlType(name = CriteriaBooleanValue.Constants.TYPE_NAME)
38 public final class CriteriaBooleanValue implements CriteriaValue<Boolean> {
39
40 @XmlValue
41 private final Boolean value;
42
43 CriteriaBooleanValue() {
44 this.value = null;
45 }
46
47 CriteriaBooleanValue(Boolean value) {
48 if (value == null) {
49 throw new IllegalArgumentException("Value cannot be null.");
50 }
51 this.value = value;
52 }
53
54 @Override
55 public Boolean getValue() {
56 return value;
57 }
58
59 @Override
60 public int hashCode() {
61 return HashCodeBuilder.reflectionHashCode(this);
62 }
63
64 @Override
65 public boolean equals(Object obj) {
66 return EqualsBuilder.reflectionEquals(obj, this);
67 }
68
69 @Override
70 public String toString() {
71 return ToStringBuilder.reflectionToString(this);
72 }
73
74
75
76
77 static class Constants {
78 final static String ROOT_ELEMENT_NAME = "booleanValue";
79 final static String TYPE_NAME = "CriteriaBooleanValueType";
80 }
81
82 }