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