1 package org.kuali.kpme.edo.api.committeesready;
2
3 import java.io.Serializable;
4 import java.util.Collection;
5
6 import javax.xml.bind.annotation.XmlAccessType;
7 import javax.xml.bind.annotation.XmlAccessorType;
8 import javax.xml.bind.annotation.XmlAnyElement;
9 import javax.xml.bind.annotation.XmlElement;
10 import javax.xml.bind.annotation.XmlRootElement;
11 import javax.xml.bind.annotation.XmlType;
12 import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
13
14 import org.joda.time.DateTime;
15 import org.kuali.kpme.core.api.groupkey.HrGroupKey;
16 import org.kuali.rice.core.api.CoreConstants;
17 import org.kuali.rice.core.api.mo.AbstractDataTransferObject;
18 import org.kuali.rice.core.api.mo.ModelBuilder;
19 import org.kuali.rice.core.api.util.jaxb.DateTimeAdapter;
20 import org.w3c.dom.Element;
21
22 @XmlRootElement(name = EdoCommitteesReady.Constants.ROOT_ELEMENT_NAME)
23 @XmlAccessorType(XmlAccessType.NONE)
24 @XmlType(name = EdoCommitteesReady.Constants.TYPE_NAME, propOrder = {
25 EdoCommitteesReady.Elements.EDO_COMMITTEES_READY_ID,
26 EdoCommitteesReady.Elements.READY,
27 CoreConstants.CommonElements.VERSION_NUMBER,
28 CoreConstants.CommonElements.OBJECT_ID,
29 EdoCommitteesReady.Elements.USER_PRINCIPAL_ID,
30 EdoCommitteesReady.Elements.GROUP_KEY_CODE,
31 EdoCommitteesReady.Elements.GROUP_KEY,
32 EdoCommitteesReady.Elements.CREATE_TIME,
33 CoreConstants.CommonElements.FUTURE_ELEMENTS
34 })
35 public final class EdoCommitteesReady
36 extends AbstractDataTransferObject
37 implements EdoCommitteesReadyContract
38 {
39
40 @XmlElement(name = Elements.EDO_COMMITTEES_READY_ID, required = false)
41 private final String edoCommitteesReadyId;
42 @XmlElement(name = Elements.READY, required = false)
43 private final boolean ready;
44 @XmlElement(name = CoreConstants.CommonElements.VERSION_NUMBER, required = false)
45 private final Long versionNumber;
46 @XmlElement(name = CoreConstants.CommonElements.OBJECT_ID, required = false)
47 private final String objectId;
48 @XmlElement(name = Elements.USER_PRINCIPAL_ID, required = false)
49 private final String userPrincipalId;
50 @XmlElement(name = Elements.GROUP_KEY_CODE, required = false)
51 private final String groupKeyCode;
52 @XmlElement(name = Elements.GROUP_KEY, required = false)
53 private final HrGroupKey groupKey;
54 @XmlElement(name = Elements.CREATE_TIME, required = false)
55 @XmlJavaTypeAdapter(DateTimeAdapter.class)
56 private final DateTime createTime;
57 @SuppressWarnings("unused")
58 @XmlAnyElement
59 private final Collection<Element> _futureElements = null;
60
61
62
63
64
65 private EdoCommitteesReady() {
66 this.edoCommitteesReadyId = null;
67 this.ready = false;
68 this.versionNumber = null;
69 this.objectId = null;
70 this.userPrincipalId = null;
71 this.groupKeyCode = null;
72 this.groupKey = null;
73 this.createTime = null;
74 }
75
76 private EdoCommitteesReady(Builder builder) {
77 this.edoCommitteesReadyId = builder.getEdoCommitteesReadyId();
78 this.ready = builder.isReady();
79 this.versionNumber = builder.getVersionNumber();
80 this.objectId = builder.getObjectId();
81 this.userPrincipalId = builder.getUserPrincipalId();
82 this.groupKeyCode = builder.getGroupKeyCode();
83 this.groupKey = builder.getGroupKey() == null ? null : builder.getGroupKey().build();
84 this.createTime = builder.getCreateTime();
85 }
86
87 @Override
88 public String getEdoCommitteesReadyId() {
89 return this.edoCommitteesReadyId;
90 }
91
92 @Override
93 public boolean isReady() {
94 return this.ready;
95 }
96
97 @Override
98 public Long getVersionNumber() {
99 return this.versionNumber;
100 }
101
102 @Override
103 public String getObjectId() {
104 return this.objectId;
105 }
106
107 @Override
108 public String getUserPrincipalId() {
109 return this.userPrincipalId;
110 }
111
112 @Override
113 public String getGroupKeyCode() {
114 return this.groupKeyCode;
115 }
116
117 @Override
118 public HrGroupKey getGroupKey() {
119 return this.groupKey;
120 }
121
122 @Override
123 public DateTime getCreateTime() {
124 return this.createTime;
125 }
126
127
128
129
130
131
132 public final static class Builder
133 implements Serializable, EdoCommitteesReadyContract, ModelBuilder
134 {
135
136 private String edoCommitteesReadyId;
137 private DateTime fullDateTime;
138 private boolean ready;
139 private Long versionNumber;
140 private String objectId;
141 private String userPrincipalId;
142 private String groupKeyCode;
143 private HrGroupKey.Builder groupKey;
144 private DateTime createTime;
145
146 private Builder() {
147
148 }
149
150 public static Builder create() {
151
152 return new Builder();
153 }
154
155 public static Builder create(EdoCommitteesReadyContract contract) {
156 if (contract == null) {
157 throw new IllegalArgumentException("contract was null");
158 }
159
160 Builder builder = create();
161 builder.setEdoCommitteesReadyId(contract.getEdoCommitteesReadyId());
162 builder.setReady(contract.isReady());
163 builder.setVersionNumber(contract.getVersionNumber());
164 builder.setObjectId(contract.getObjectId());
165 builder.setUserPrincipalId(contract.getUserPrincipalId());
166 builder.setGroupKeyCode(contract.getGroupKeyCode());
167 builder.setGroupKey(contract.getGroupKey() == null ? null : HrGroupKey.Builder.create(contract.getGroupKey()));
168 builder.setCreateTime(contract.getCreateTime());
169 return builder;
170 }
171
172 public EdoCommitteesReady build() {
173 return new EdoCommitteesReady(this);
174 }
175
176 @Override
177 public String getEdoCommitteesReadyId() {
178 return this.edoCommitteesReadyId;
179 }
180
181 @Override
182 public boolean isReady() {
183 return this.ready;
184 }
185
186 @Override
187 public Long getVersionNumber() {
188 return this.versionNumber;
189 }
190
191 @Override
192 public String getObjectId() {
193 return this.objectId;
194 }
195
196 @Override
197 public String getUserPrincipalId() {
198 return this.userPrincipalId;
199 }
200
201 @Override
202 public String getGroupKeyCode() {
203 return this.groupKeyCode;
204 }
205
206 @Override
207 public HrGroupKey.Builder getGroupKey() {
208 return this.groupKey;
209 }
210
211 @Override
212 public DateTime getCreateTime() {
213 return this.createTime;
214 }
215
216 public void setEdoCommitteesReadyId(String edoCommitteesReadyId) {
217
218 this.edoCommitteesReadyId = edoCommitteesReadyId;
219 }
220
221 public void setFullDateTime(DateTime fullDateTime) {
222
223 this.fullDateTime = fullDateTime;
224 }
225
226 public void setReady(boolean ready) {
227
228 this.ready = ready;
229 }
230
231 public void setVersionNumber(Long versionNumber) {
232
233 this.versionNumber = versionNumber;
234 }
235
236 public void setObjectId(String objectId) {
237
238 this.objectId = objectId;
239 }
240
241 public void setUserPrincipalId(String userPrincipalId) {
242
243 this.userPrincipalId = userPrincipalId;
244 }
245
246 public void setGroupKeyCode(String groupKeyCode) {
247
248 this.groupKeyCode = groupKeyCode;
249 }
250
251 public void setGroupKey(HrGroupKey.Builder groupKey) {
252
253 this.groupKey = groupKey;
254 }
255
256 public void setCreateTime(DateTime createTime) {
257
258 this.createTime = createTime;
259 }
260
261 }
262
263
264
265
266
267
268 static class Constants {
269
270 final static String ROOT_ELEMENT_NAME = "edoCommitteesReady";
271 final static String TYPE_NAME = "EdoCommitteesReadyType";
272
273 }
274
275
276
277
278
279
280 static class Elements {
281
282 final static String EDO_COMMITTEES_READY_ID = "edoCommitteesReadyId";
283 final static String READY = "ready";
284 final static String USER_PRINCIPAL_ID = "userPrincipalId";
285 final static String GROUP_KEY_CODE = "groupKeyCode";
286 final static String GROUP_KEY = "groupKey";
287 final static String CREATE_TIME = "createTime";
288
289 }
290
291 }