1 | |
|
2 | |
|
3 | |
|
4 | |
|
5 | |
|
6 | |
|
7 | |
|
8 | |
|
9 | |
|
10 | |
|
11 | |
|
12 | |
|
13 | |
|
14 | |
|
15 | |
|
16 | |
package org.kuali.rice.kew.api.document; |
17 | |
|
18 | |
import java.io.Serializable; |
19 | |
import java.util.Collection; |
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.XmlElement; |
25 | |
import javax.xml.bind.annotation.XmlRootElement; |
26 | |
import javax.xml.bind.annotation.XmlType; |
27 | |
|
28 | |
import org.apache.commons.lang.builder.EqualsBuilder; |
29 | |
import org.apache.commons.lang.builder.HashCodeBuilder; |
30 | |
import org.apache.commons.lang.builder.ToStringBuilder; |
31 | |
import org.kuali.rice.core.api.CoreConstants; |
32 | |
import org.kuali.rice.core.api.mo.ModelBuilder; |
33 | |
import org.kuali.rice.core.api.mo.ModelObjectComplete; |
34 | |
import org.w3c.dom.Element; |
35 | |
|
36 | |
@XmlRootElement(name = RouteNodeInstanceState.Constants.ROOT_ELEMENT_NAME) |
37 | |
@XmlAccessorType(XmlAccessType.NONE) |
38 | |
@XmlType(name = RouteNodeInstanceState.Constants.TYPE_NAME, propOrder = { |
39 | |
RouteNodeInstanceState.Elements.VALUE, |
40 | |
RouteNodeInstanceState.Elements.KEY, |
41 | |
RouteNodeInstanceState.Elements.ID, |
42 | |
CoreConstants.CommonElements.FUTURE_ELEMENTS |
43 | |
}) |
44 | 0 | public final class RouteNodeInstanceState |
45 | |
implements ModelObjectComplete, RouteNodeInstanceStateContract |
46 | |
{ |
47 | |
|
48 | |
@XmlElement(name = Elements.ID, required = false) |
49 | |
private final String id; |
50 | |
@XmlElement(name = Elements.VALUE, required = false) |
51 | |
private final String value; |
52 | |
@XmlElement(name = Elements.KEY, required = false) |
53 | |
private final String key; |
54 | 0 | @SuppressWarnings("unused") |
55 | |
@XmlAnyElement |
56 | |
private final Collection<Element> _futureElements = null; |
57 | |
|
58 | |
|
59 | |
|
60 | |
|
61 | |
|
62 | 0 | private RouteNodeInstanceState() { |
63 | 0 | this.id = null; |
64 | 0 | this.value = null; |
65 | 0 | this.key = null; |
66 | 0 | } |
67 | |
|
68 | 0 | private RouteNodeInstanceState(Builder builder) { |
69 | 0 | this.id = builder.getId(); |
70 | 0 | this.value = builder.getValue(); |
71 | 0 | this.key = builder.getKey(); |
72 | 0 | } |
73 | |
|
74 | |
@Override |
75 | |
public String getId() { |
76 | 0 | return this.id; |
77 | |
} |
78 | |
|
79 | |
@Override |
80 | |
public String getValue() { |
81 | 0 | return this.value; |
82 | |
} |
83 | |
|
84 | |
@Override |
85 | |
public String getKey() { |
86 | 0 | return this.key; |
87 | |
} |
88 | |
|
89 | |
@Override |
90 | |
public int hashCode() { |
91 | 0 | return HashCodeBuilder.reflectionHashCode(this, Constants.HASH_CODE_EQUALS_EXCLUDE); |
92 | |
} |
93 | |
|
94 | |
@Override |
95 | |
public boolean equals(Object object) { |
96 | 0 | return EqualsBuilder.reflectionEquals(object, this, Constants.HASH_CODE_EQUALS_EXCLUDE); |
97 | |
} |
98 | |
|
99 | |
@Override |
100 | |
public String toString() { |
101 | 0 | return ToStringBuilder.reflectionToString(this); |
102 | |
} |
103 | |
|
104 | |
|
105 | |
|
106 | |
|
107 | 0 | public final static class Builder |
108 | |
implements Serializable, ModelBuilder, RouteNodeInstanceStateContract |
109 | |
{ |
110 | |
|
111 | |
private String id; |
112 | |
private String value; |
113 | |
private String key; |
114 | |
|
115 | 0 | private Builder() { |
116 | |
|
117 | 0 | } |
118 | |
|
119 | |
public static Builder create() { |
120 | |
|
121 | 0 | return new Builder(); |
122 | |
} |
123 | |
|
124 | |
public static Builder create(RouteNodeInstanceStateContract contract) { |
125 | 0 | if (contract == null) { |
126 | 0 | throw new IllegalArgumentException("contract was null"); |
127 | |
} |
128 | |
|
129 | 0 | Builder builder = create(); |
130 | 0 | builder.setId(contract.getId()); |
131 | 0 | builder.setValue(contract.getValue()); |
132 | 0 | builder.setKey(contract.getKey()); |
133 | 0 | return builder; |
134 | |
} |
135 | |
|
136 | |
public RouteNodeInstanceState build() { |
137 | 0 | return new RouteNodeInstanceState(this); |
138 | |
} |
139 | |
|
140 | |
@Override |
141 | |
public String getValue() { |
142 | 0 | return this.value; |
143 | |
} |
144 | |
|
145 | |
@Override |
146 | |
public String getKey() { |
147 | 0 | return this.key; |
148 | |
} |
149 | |
|
150 | |
@Override |
151 | |
public String getId() { |
152 | 0 | return this.id; |
153 | |
} |
154 | |
|
155 | |
public void setValue(String value) { |
156 | |
|
157 | 0 | this.value = value; |
158 | 0 | } |
159 | |
|
160 | |
public void setKey(String key) { |
161 | |
|
162 | 0 | this.key = key; |
163 | 0 | } |
164 | |
|
165 | |
public void setId(String id) { |
166 | |
|
167 | 0 | this.id = id; |
168 | 0 | } |
169 | |
|
170 | |
} |
171 | |
|
172 | |
|
173 | |
|
174 | |
|
175 | |
|
176 | |
|
177 | 0 | static class Constants { |
178 | |
|
179 | |
final static String ROOT_ELEMENT_NAME = "routeNodeInstanceState"; |
180 | |
final static String TYPE_NAME = "RouteNodeInstanceStateType"; |
181 | 0 | final static String[] HASH_CODE_EQUALS_EXCLUDE = new String[] {CoreConstants.CommonElements.FUTURE_ELEMENTS }; |
182 | |
|
183 | |
} |
184 | |
|
185 | |
|
186 | |
|
187 | |
|
188 | |
|
189 | |
|
190 | 0 | static class Elements { |
191 | |
|
192 | |
final static String VALUE = "value"; |
193 | |
final static String KEY = "key"; |
194 | |
final static String ID = "id"; |
195 | |
|
196 | |
} |
197 | |
|
198 | |
} |
199 | |
|