View Javadoc
1   /**
2    * Copyright 2004-2014 The Kuali Foundation
3    *
4    * Licensed under the Educational Community License, Version 2.0 (the "License");
5    * you may not use this file except in compliance with the License.
6    * You may obtain a copy of the License at
7    *
8    * http://www.opensource.org/licenses/ecl2.php
9    *
10   * Unless required by applicable law or agreed to in writing, software
11   * distributed under the License is distributed on an "AS IS" BASIS,
12   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13   * See the License for the specific language governing permissions and
14   * limitations under the License.
15   */
16  package org.kuali.kpme.pm.api.classification.qual;
17  
18  import java.io.Serializable;
19  import java.util.Collection;
20  import javax.xml.bind.annotation.XmlAccessType;
21  import javax.xml.bind.annotation.XmlAccessorType;
22  import javax.xml.bind.annotation.XmlAnyElement;
23  import javax.xml.bind.annotation.XmlElement;
24  import javax.xml.bind.annotation.XmlRootElement;
25  import javax.xml.bind.annotation.XmlType;
26  import org.joda.time.LocalDate;
27  import org.kuali.rice.core.api.CoreConstants;
28  import org.kuali.rice.core.api.mo.AbstractDataTransferObject;
29  import org.kuali.rice.core.api.mo.ModelBuilder;
30  import org.w3c.dom.Element;
31  
32  @XmlRootElement(name = ClassificationQualification.Constants.ROOT_ELEMENT_NAME)
33  @XmlAccessorType(XmlAccessType.NONE)
34  @XmlType(name = ClassificationQualification.Constants.TYPE_NAME, propOrder = {
35      ClassificationQualification.Elements.QUALIFICATION_VALUE,
36      ClassificationQualification.Elements.QUALIFICATION_TYPE,
37      ClassificationQualification.Elements.DISPLAY_ORDER,
38      ClassificationQualification.Elements.TYPE_VALUE,
39      ClassificationQualification.Elements.QUALIFIER,
40      ClassificationQualification.Elements.PM_CLASSIFICATION_QUALIFICATION_ID,
41      ClassificationQualification.Elements.PM_POSITION_CLASS_ID,
42      ClassificationQualification.Elements.EFFECTIVE_LOCAL_DATE_OF_OWNER,
43      CoreConstants.CommonElements.VERSION_NUMBER,
44      CoreConstants.CommonElements.OBJECT_ID,
45      CoreConstants.CommonElements.FUTURE_ELEMENTS
46  })
47  public final class ClassificationQualification extends AbstractDataTransferObject implements ClassificationQualificationContract {
48  
49  	private static final long serialVersionUID = -204740505016136600L;
50  	
51  	@XmlElement(name = Elements.QUALIFICATION_VALUE, required = false)
52      private final String qualificationValue;
53      @XmlElement(name = Elements.QUALIFICATION_TYPE, required = false)
54      private final String qualificationType;
55      @XmlElement(name = Elements.DISPLAY_ORDER, required = false)
56      private final String displayOrder;
57      @XmlElement(name = Elements.TYPE_VALUE, required = false)
58      private final String typeValue;
59      @XmlElement(name = Elements.QUALIFIER, required = false)
60      private final String qualifier;
61      @XmlElement(name = Elements.PM_CLASSIFICATION_QUALIFICATION_ID, required = false)
62      private final String pmClassificationQualificationId;
63      @XmlElement(name = Elements.PM_POSITION_CLASS_ID, required = false)
64      private final String pmPositionClassId;
65      @XmlElement(name = Elements.EFFECTIVE_LOCAL_DATE_OF_OWNER, required = false)
66      private final LocalDate effectiveLocalDateOfOwner;
67      @XmlElement(name = CoreConstants.CommonElements.VERSION_NUMBER, required = false)
68      private final Long versionNumber;
69      @XmlElement(name = CoreConstants.CommonElements.OBJECT_ID, required = false)
70      private final String objectId;
71      @XmlAnyElement
72      private final Collection<Element> _futureElements = null;
73  
74      /**
75       * Private constructor used only by JAXB.
76       * 
77       */
78      private ClassificationQualification() {
79          this.qualificationValue = null;
80          this.qualificationType = null;
81          this.displayOrder = null;
82          this.typeValue = null;
83          this.qualifier = null;
84          this.pmClassificationQualificationId = null;
85          this.pmPositionClassId = null;
86          this.effectiveLocalDateOfOwner = null;
87          this.versionNumber = null;
88          this.objectId = null;
89      }
90  
91      private ClassificationQualification(Builder builder) {
92          this.qualificationValue = builder.getQualificationValue();
93          this.qualificationType = builder.getQualificationType();
94          this.displayOrder = builder.getDisplayOrder();
95          this.typeValue = builder.getTypeValue();
96          this.qualifier = builder.getQualifier();
97          this.pmClassificationQualificationId = builder.getPmClassificationQualificationId();
98          this.pmPositionClassId = builder.getPmPositionClassId();
99          this.effectiveLocalDateOfOwner = builder.getEffectiveLocalDateOfOwner();
100         this.versionNumber = builder.getVersionNumber();
101         this.objectId = builder.getObjectId();
102     }
103 
104     @Override
105     public String getQualificationValue() {
106         return this.qualificationValue;
107     }
108 
109     @Override
110     public String getQualificationType() {
111         return this.qualificationType;
112     }
113 
114     @Override
115     public String getDisplayOrder() {
116         return this.displayOrder;
117     }
118 
119     @Override
120     public String getTypeValue() {
121         return this.typeValue;
122     }
123 
124     @Override
125     public String getQualifier() {
126         return this.qualifier;
127     }
128 
129     @Override
130     public String getPmClassificationQualificationId() {
131         return this.pmClassificationQualificationId;
132     }
133 
134     @Override
135     public String getPmPositionClassId() {
136         return this.pmPositionClassId;
137     }
138 
139     @Override
140     public LocalDate getEffectiveLocalDateOfOwner() {
141         return this.effectiveLocalDateOfOwner;
142     }
143 
144     @Override
145     public Long getVersionNumber() {
146         return this.versionNumber;
147     }
148 
149     @Override
150     public String getObjectId() {
151         return this.objectId;
152     }
153 
154 
155     /**
156      * A builder which can be used to construct {@link ClassificationQualification} instances.  Enforces the constraints of the {@link ClassificationQualificationContract}.
157      * 
158      */
159     public final static class Builder implements Serializable, ClassificationQualificationContract, ModelBuilder {
160 
161     	private static final long serialVersionUID = -5703146256835808803L;
162     	
163 		private String qualificationValue;
164         private String qualificationType;
165         private String displayOrder;
166         private String typeValue;
167         private String qualifier;
168         private String pmClassificationQualificationId;
169         private String pmPositionClassId;
170         private LocalDate effectiveLocalDateOfOwner;
171         private Long versionNumber;
172         private String objectId;
173 
174         private Builder() {
175             // TODO modify this constructor as needed to pass any required values and invoke the appropriate 'setter' methods
176         }
177 
178         public static Builder create() {
179 
180             return new Builder();
181         }
182 
183         public static Builder create(ClassificationQualificationContract contract) {
184             if (contract == null) {
185                 throw new IllegalArgumentException("contract was null");
186             }
187 
188             Builder builder = create();
189             builder.setQualificationValue(contract.getQualificationValue());
190             builder.setQualificationType(contract.getQualificationType());
191             builder.setDisplayOrder(contract.getDisplayOrder());
192             builder.setTypeValue(contract.getTypeValue());
193             builder.setQualifier(contract.getQualifier());
194             builder.setPmClassificationQualificationId(contract.getPmClassificationQualificationId());
195             builder.setPmPositionClassId(contract.getPmPositionClassId());
196             builder.setEffectiveLocalDateOfOwner(contract.getEffectiveLocalDateOfOwner());
197             builder.setVersionNumber(contract.getVersionNumber());
198             builder.setObjectId(contract.getObjectId());
199             return builder;
200         }
201 
202         public ClassificationQualification build() {
203             return new ClassificationQualification(this);
204         }
205 
206         @Override
207         public String getQualificationValue() {
208             return this.qualificationValue;
209         }
210 
211         @Override
212         public String getQualificationType() {
213             return this.qualificationType;
214         }
215 
216         @Override
217         public String getDisplayOrder() {
218             return this.displayOrder;
219         }
220 
221         @Override
222         public String getTypeValue() {
223             return this.typeValue;
224         }
225 
226         @Override
227         public String getQualifier() {
228             return this.qualifier;
229         }
230 
231         @Override
232         public String getPmClassificationQualificationId() {
233             return this.pmClassificationQualificationId;
234         }
235 
236         @Override
237         public String getPmPositionClassId() {
238             return this.pmPositionClassId;
239         }
240 
241         @Override
242         public LocalDate getEffectiveLocalDateOfOwner() {
243             return this.effectiveLocalDateOfOwner;
244         }
245 
246         @Override
247         public Long getVersionNumber() {
248             return this.versionNumber;
249         }
250 
251         @Override
252         public String getObjectId() {
253             return this.objectId;
254         }
255 
256         public void setQualificationValue(String qualificationValue) {
257 
258             this.qualificationValue = qualificationValue;
259         }
260 
261         public void setQualificationType(String qualificationType) {
262 
263             this.qualificationType = qualificationType;
264         }
265 
266         public void setDisplayOrder(String displayOrder) {
267 
268             this.displayOrder = displayOrder;
269         }
270 
271         public void setTypeValue(String typeValue) {
272 
273             this.typeValue = typeValue;
274         }
275 
276         public void setQualifier(String qualifier) {
277 
278             this.qualifier = qualifier;
279         }
280 
281         public void setPmClassificationQualificationId(String pmClassificationQualificationId) {
282 
283             this.pmClassificationQualificationId = pmClassificationQualificationId;
284         }
285 
286         public void setPmPositionClassId(String pmPositionClassId) {
287 
288             this.pmPositionClassId = pmPositionClassId;
289         }
290 
291         public void setEffectiveLocalDateOfOwner(LocalDate effectiveLocalDateOfOwner) {
292 
293             this.effectiveLocalDateOfOwner = effectiveLocalDateOfOwner;
294         }
295 
296         public void setVersionNumber(Long versionNumber) {
297 
298             this.versionNumber = versionNumber;
299         }
300 
301         public void setObjectId(String objectId) {
302 
303             this.objectId = objectId;
304         }
305 
306     }
307 
308 
309     /**
310      * Defines some internal constants used on this class.
311      * 
312      */
313     static class Constants {
314 
315         final static String ROOT_ELEMENT_NAME = "classificationQualification";
316         final static String TYPE_NAME = "ClassificationQualificationType";
317 
318     }
319 
320 
321     /**
322      * A private class which exposes constants which define the XML element names to use when this object is marshalled to XML.
323      * 
324      */
325     static class Elements {
326 
327         final static String QUALIFICATION_VALUE = "qualificationValue";
328         final static String QUALIFICATION_TYPE = "qualificationType";
329         final static String DISPLAY_ORDER = "displayOrder";
330         final static String TYPE_VALUE = "typeValue";
331         final static String QUALIFIER = "qualifier";
332         final static String PM_CLASSIFICATION_QUALIFICATION_ID = "pmClassificationQualificationId";
333         final static String PM_POSITION_CLASS_ID = "pmPositionClassId";
334         final static String EFFECTIVE_LOCAL_DATE_OF_OWNER = "effectiveLocalDateOfOwner";
335 
336     }
337 
338 }