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 | |
import java.util.List; |
21 | |
|
22 | |
import javax.xml.bind.annotation.XmlAccessType; |
23 | |
import javax.xml.bind.annotation.XmlAccessorType; |
24 | |
import javax.xml.bind.annotation.XmlAnyElement; |
25 | |
import javax.xml.bind.annotation.XmlElement; |
26 | |
import javax.xml.bind.annotation.XmlRootElement; |
27 | |
import javax.xml.bind.annotation.XmlType; |
28 | |
|
29 | |
import org.apache.commons.lang.builder.EqualsBuilder; |
30 | |
import org.apache.commons.lang.builder.HashCodeBuilder; |
31 | |
import org.apache.commons.lang.builder.ToStringBuilder; |
32 | |
import org.kuali.rice.core.api.CoreConstants; |
33 | |
import org.kuali.rice.core.api.mo.ModelBuilder; |
34 | |
import org.kuali.rice.core.api.mo.ModelObjectComplete; |
35 | |
import org.w3c.dom.Element; |
36 | |
|
37 | |
@XmlRootElement(name = RouteNodeInstance.Constants.ROOT_ELEMENT_NAME) |
38 | |
@XmlAccessorType(XmlAccessType.NONE) |
39 | |
@XmlType(name = RouteNodeInstance.Constants.TYPE_NAME, propOrder = { |
40 | |
RouteNodeInstance.Elements.NAME, |
41 | |
RouteNodeInstance.Elements.STATE, |
42 | |
RouteNodeInstance.Elements.DOCUMENT_ID, |
43 | |
RouteNodeInstance.Elements.BRANCH_ID, |
44 | |
RouteNodeInstance.Elements.ROUTE_NODE_ID, |
45 | |
RouteNodeInstance.Elements.PROCESS_ID, |
46 | |
RouteNodeInstance.Elements.ACTIVE, |
47 | |
RouteNodeInstance.Elements.COMPLETE, |
48 | |
RouteNodeInstance.Elements.INITIAL, |
49 | |
RouteNodeInstance.Elements.ID, |
50 | |
CoreConstants.CommonElements.FUTURE_ELEMENTS |
51 | |
}) |
52 | 0 | public final class RouteNodeInstance |
53 | |
implements ModelObjectComplete, RouteNodeInstanceContract |
54 | |
{ |
55 | |
|
56 | |
@XmlElement(name = Elements.NAME, required = false) |
57 | |
private final String name; |
58 | |
@XmlElement(name = Elements.STATE, required = false) |
59 | |
private final List state; |
60 | |
@XmlElement(name = Elements.DOCUMENT_ID, required = false) |
61 | |
private final String documentId; |
62 | |
@XmlElement(name = Elements.BRANCH_ID, required = false) |
63 | |
private final String branchId; |
64 | |
@XmlElement(name = Elements.ROUTE_NODE_ID, required = false) |
65 | |
private final String routeNodeId; |
66 | |
@XmlElement(name = Elements.PROCESS_ID, required = false) |
67 | |
private final String processId; |
68 | |
@XmlElement(name = Elements.ACTIVE, required = false) |
69 | |
private final boolean active; |
70 | |
@XmlElement(name = Elements.COMPLETE, required = false) |
71 | |
private final boolean complete; |
72 | |
@XmlElement(name = Elements.INITIAL, required = false) |
73 | |
private final boolean initial; |
74 | |
@XmlElement(name = Elements.ID, required = false) |
75 | |
private final String id; |
76 | 0 | @SuppressWarnings("unused") |
77 | |
@XmlAnyElement |
78 | |
private final Collection<Element> _futureElements = null; |
79 | |
|
80 | |
|
81 | |
|
82 | |
|
83 | |
|
84 | 0 | private RouteNodeInstance() { |
85 | 0 | this.name = null; |
86 | 0 | this.state = null; |
87 | 0 | this.documentId = null; |
88 | 0 | this.branchId = null; |
89 | 0 | this.routeNodeId = null; |
90 | 0 | this.processId = null; |
91 | 0 | this.active = false; |
92 | 0 | this.complete = false; |
93 | 0 | this.initial = false; |
94 | 0 | this.id = null; |
95 | 0 | } |
96 | |
|
97 | 0 | private RouteNodeInstance(Builder builder) { |
98 | 0 | this.name = builder.getName(); |
99 | 0 | this.state = builder.getState(); |
100 | 0 | this.documentId = builder.getDocumentId(); |
101 | 0 | this.branchId = builder.getBranchId(); |
102 | 0 | this.routeNodeId = builder.getRouteNodeId(); |
103 | 0 | this.processId = builder.getProcessId(); |
104 | 0 | this.active = builder.isActive(); |
105 | 0 | this.complete = builder.isComplete(); |
106 | 0 | this.initial = builder.isInitial(); |
107 | 0 | this.id = builder.getId(); |
108 | 0 | } |
109 | |
|
110 | |
@Override |
111 | |
public String getName() { |
112 | 0 | return this.name; |
113 | |
} |
114 | |
|
115 | |
@Override |
116 | |
public List getState() { |
117 | 0 | return this.state; |
118 | |
} |
119 | |
|
120 | |
@Override |
121 | |
public String getDocumentId() { |
122 | 0 | return this.documentId; |
123 | |
} |
124 | |
|
125 | |
@Override |
126 | |
public String getBranchId() { |
127 | 0 | return this.branchId; |
128 | |
} |
129 | |
|
130 | |
@Override |
131 | |
public String getRouteNodeId() { |
132 | 0 | return this.routeNodeId; |
133 | |
} |
134 | |
|
135 | |
@Override |
136 | |
public String getProcessId() { |
137 | 0 | return this.processId; |
138 | |
} |
139 | |
|
140 | |
@Override |
141 | |
public boolean isActive() { |
142 | 0 | return this.active; |
143 | |
} |
144 | |
|
145 | |
@Override |
146 | |
public boolean isComplete() { |
147 | 0 | return this.complete; |
148 | |
} |
149 | |
|
150 | |
@Override |
151 | |
public boolean isInitial() { |
152 | 0 | return this.initial; |
153 | |
} |
154 | |
|
155 | |
@Override |
156 | |
public String getId() { |
157 | 0 | return this.id; |
158 | |
} |
159 | |
|
160 | |
@Override |
161 | |
public int hashCode() { |
162 | 0 | return HashCodeBuilder.reflectionHashCode(this, Constants.HASH_CODE_EQUALS_EXCLUDE); |
163 | |
} |
164 | |
|
165 | |
@Override |
166 | |
public boolean equals(Object object) { |
167 | 0 | return EqualsBuilder.reflectionEquals(object, this, Constants.HASH_CODE_EQUALS_EXCLUDE); |
168 | |
} |
169 | |
|
170 | |
@Override |
171 | |
public String toString() { |
172 | 0 | return ToStringBuilder.reflectionToString(this); |
173 | |
} |
174 | |
|
175 | |
|
176 | |
|
177 | |
|
178 | |
|
179 | |
|
180 | 0 | public final static class Builder |
181 | |
implements Serializable, ModelBuilder, RouteNodeInstanceContract |
182 | |
{ |
183 | |
|
184 | |
private String name; |
185 | |
private List state; |
186 | |
private String documentId; |
187 | |
private String branchId; |
188 | |
private String routeNodeId; |
189 | |
private String processId; |
190 | |
private boolean active; |
191 | |
private boolean complete; |
192 | |
private boolean initial; |
193 | |
private String id; |
194 | |
|
195 | 0 | private Builder() { |
196 | |
|
197 | 0 | } |
198 | |
|
199 | |
public static Builder create() { |
200 | |
|
201 | 0 | return new Builder(); |
202 | |
} |
203 | |
|
204 | |
public static Builder create(RouteNodeInstanceContract contract) { |
205 | 0 | if (contract == null) { |
206 | 0 | throw new IllegalArgumentException("contract was null"); |
207 | |
} |
208 | |
|
209 | 0 | Builder builder = create(); |
210 | 0 | builder.setName(contract.getName()); |
211 | 0 | builder.setState(contract.getState()); |
212 | 0 | builder.setDocumentId(contract.getDocumentId()); |
213 | 0 | builder.setBranchId(contract.getBranchId()); |
214 | 0 | builder.setRouteNodeId(contract.getRouteNodeId()); |
215 | 0 | builder.setProcessId(contract.getProcessId()); |
216 | 0 | builder.setActive(contract.isActive()); |
217 | 0 | builder.setComplete(contract.isComplete()); |
218 | 0 | builder.setInitial(contract.isInitial()); |
219 | 0 | builder.setId(contract.getId()); |
220 | 0 | return builder; |
221 | |
} |
222 | |
|
223 | |
public RouteNodeInstance build() { |
224 | 0 | return new RouteNodeInstance(this); |
225 | |
} |
226 | |
|
227 | |
@Override |
228 | |
public String getName() { |
229 | 0 | return this.name; |
230 | |
} |
231 | |
|
232 | |
@Override |
233 | |
public List getState() { |
234 | 0 | return this.state; |
235 | |
} |
236 | |
|
237 | |
@Override |
238 | |
public String getDocumentId() { |
239 | 0 | return this.documentId; |
240 | |
} |
241 | |
|
242 | |
@Override |
243 | |
public String getBranchId() { |
244 | 0 | return this.branchId; |
245 | |
} |
246 | |
|
247 | |
@Override |
248 | |
public String getRouteNodeId() { |
249 | 0 | return this.routeNodeId; |
250 | |
} |
251 | |
|
252 | |
@Override |
253 | |
public String getProcessId() { |
254 | 0 | return this.processId; |
255 | |
} |
256 | |
|
257 | |
@Override |
258 | |
public boolean isActive() { |
259 | 0 | return this.active; |
260 | |
} |
261 | |
|
262 | |
@Override |
263 | |
public boolean isComplete() { |
264 | 0 | return this.complete; |
265 | |
} |
266 | |
|
267 | |
@Override |
268 | |
public boolean isInitial() { |
269 | 0 | return this.initial; |
270 | |
} |
271 | |
|
272 | |
@Override |
273 | |
public String getId() { |
274 | 0 | return this.id; |
275 | |
} |
276 | |
|
277 | |
public void setName(String name) { |
278 | |
|
279 | 0 | this.name = name; |
280 | 0 | } |
281 | |
|
282 | |
public void setState(List state) { |
283 | |
|
284 | 0 | this.state = state; |
285 | 0 | } |
286 | |
|
287 | |
public void setDocumentId(String documentId) { |
288 | |
|
289 | 0 | this.documentId = documentId; |
290 | 0 | } |
291 | |
|
292 | |
public void setBranchId(String branchId) { |
293 | |
|
294 | 0 | this.branchId = branchId; |
295 | 0 | } |
296 | |
|
297 | |
public void setRouteNodeId(String routeNodeId) { |
298 | |
|
299 | 0 | this.routeNodeId = routeNodeId; |
300 | 0 | } |
301 | |
|
302 | |
public void setProcessId(String processId) { |
303 | |
|
304 | 0 | this.processId = processId; |
305 | 0 | } |
306 | |
|
307 | |
public void setActive(boolean active) { |
308 | |
|
309 | 0 | this.active = active; |
310 | 0 | } |
311 | |
|
312 | |
public void setComplete(boolean complete) { |
313 | |
|
314 | 0 | this.complete = complete; |
315 | 0 | } |
316 | |
|
317 | |
public void setInitial(boolean initial) { |
318 | |
|
319 | 0 | this.initial = initial; |
320 | 0 | } |
321 | |
|
322 | |
public void setId(String id) { |
323 | |
|
324 | 0 | this.id = id; |
325 | 0 | } |
326 | |
|
327 | |
} |
328 | |
|
329 | |
|
330 | |
|
331 | |
|
332 | |
|
333 | |
|
334 | 0 | static class Constants { |
335 | |
|
336 | |
final static String ROOT_ELEMENT_NAME = "routeNodeInstance"; |
337 | |
final static String TYPE_NAME = "RouteNodeInstanceType"; |
338 | 0 | final static String[] HASH_CODE_EQUALS_EXCLUDE = new String[] {CoreConstants.CommonElements.FUTURE_ELEMENTS }; |
339 | |
|
340 | |
} |
341 | |
|
342 | |
|
343 | |
|
344 | |
|
345 | |
|
346 | |
|
347 | 0 | static class Elements { |
348 | |
|
349 | |
final static String NAME = "name"; |
350 | |
final static String STATE = "state"; |
351 | |
final static String DOCUMENT_ID = "documentId"; |
352 | |
final static String BRANCH_ID = "branchId"; |
353 | |
final static String ROUTE_NODE_ID = "routeNodeId"; |
354 | |
final static String PROCESS_ID = "processId"; |
355 | |
final static String ACTIVE = "active"; |
356 | |
final static String COMPLETE = "complete"; |
357 | |
final static String INITIAL = "initial"; |
358 | |
final static String ID = "id"; |
359 | |
|
360 | |
} |
361 | |
|
362 | |
} |