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.position;
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 = PositionQualification.Constants.ROOT_ELEMENT_NAME)
33  @XmlAccessorType(XmlAccessType.NONE)
34  @XmlType(name = PositionQualification.Constants.TYPE_NAME, propOrder = {
35      PositionQualification.Elements.QUALIFICATION_VALUE,
36      PositionQualification.Elements.QUALIFICATION_TYPE,
37      PositionQualification.Elements.PM_QUALIFICATION_ID,
38      PositionQualification.Elements.TYPE_VALUE,
39      PositionQualification.Elements.QUALIFIER,
40      PositionQualification.Elements.HR_POSITION_ID,
41      PositionQualification.Elements.EFFECTIVE_LOCAL_DATE_OF_OWNER,
42      CoreConstants.CommonElements.VERSION_NUMBER,
43      CoreConstants.CommonElements.OBJECT_ID,
44      CoreConstants.CommonElements.FUTURE_ELEMENTS
45  })
46  public final class PositionQualification extends AbstractDataTransferObject implements PositionQualificationContract {
47  
48  	private static final long serialVersionUID = -5011017970608326168L;
49  	
50  	@XmlElement(name = Elements.QUALIFICATION_VALUE, required = false)
51      private final String qualificationValue;
52      @XmlElement(name = Elements.QUALIFICATION_TYPE, required = false)
53      private final String qualificationType;
54      @XmlElement(name = Elements.PM_QUALIFICATION_ID, required = false)
55      private final String pmQualificationId;
56      @XmlElement(name = Elements.TYPE_VALUE, required = false)
57      private final String typeValue;
58      @XmlElement(name = Elements.QUALIFIER, required = false)
59      private final String qualifier;
60      @XmlElement(name = Elements.HR_POSITION_ID, required = false)
61      private final String hrPositionId;
62      @XmlElement(name = Elements.EFFECTIVE_LOCAL_DATE_OF_OWNER, required = false)
63      private final LocalDate effectiveLocalDateOfOwner;
64      @XmlElement(name = CoreConstants.CommonElements.VERSION_NUMBER, required = false)
65      private final Long versionNumber;
66      @XmlElement(name = CoreConstants.CommonElements.OBJECT_ID, required = false)
67      private final String objectId;
68      @XmlAnyElement
69      private final Collection<Element> _futureElements = null;
70  
71      /**
72       * Private constructor used only by JAXB.
73       * 
74       */
75      private PositionQualification() {
76          this.qualificationValue = null;
77          this.qualificationType = null;
78          this.pmQualificationId = null;
79          this.typeValue = null;
80          this.qualifier = null;
81          this.hrPositionId = null;
82          this.effectiveLocalDateOfOwner = null;
83          this.versionNumber = null;
84          this.objectId = null;
85      }
86  
87      private PositionQualification(Builder builder) {
88          this.qualificationValue = builder.getQualificationValue();
89          this.qualificationType = builder.getQualificationType();
90          this.pmQualificationId = builder.getPmQualificationId();
91          this.typeValue = builder.getTypeValue();
92          this.qualifier = builder.getQualifier();
93          this.hrPositionId = builder.getHrPositionId();
94          this.effectiveLocalDateOfOwner = builder.getEffectiveLocalDateOfOwner();
95          this.versionNumber = builder.getVersionNumber();
96          this.objectId = builder.getObjectId();
97      }
98  
99      @Override
100     public String getQualificationValue() {
101         return this.qualificationValue;
102     }
103 
104     @Override
105     public String getQualificationType() {
106         return this.qualificationType;
107     }
108 
109     @Override
110     public String getPmQualificationId() {
111         return this.pmQualificationId;
112     }
113 
114     @Override
115     public String getTypeValue() {
116         return this.typeValue;
117     }
118 
119     @Override
120     public String getQualifier() {
121         return this.qualifier;
122     }
123 
124     @Override
125     public String getHrPositionId() {
126         return this.hrPositionId;
127     }
128     
129     @Override
130     public LocalDate getEffectiveLocalDateOfOwner() {
131         return this.effectiveLocalDateOfOwner;
132     }
133 
134     @Override
135     public Long getVersionNumber() {
136         return this.versionNumber;
137     }
138 
139     @Override
140     public String getObjectId() {
141         return this.objectId;
142     }
143 
144 
145     /**
146      * A builder which can be used to construct {@link PositionQualification} instances.  Enforces the constraints of the {@link PositionQualificationContract}.
147      * 
148      */
149     public final static class Builder implements Serializable, PositionQualificationContract, ModelBuilder {
150 
151 		private static final long serialVersionUID = 1660521488150811103L;
152 		
153 		private String qualificationValue;
154         private String qualificationType;
155         private String pmQualificationId;
156         private String typeValue;
157         private String qualifier;
158         private String hrPositionId;
159         private LocalDate effectiveLocalDateOfOwner;
160         private Long versionNumber;
161         private String objectId;
162 
163         private Builder() {
164             // TODO modify this constructor as needed to pass any required values and invoke the appropriate 'setter' methods
165         }
166 
167         public static Builder create() {
168 
169             return new Builder();
170         }
171 
172         public static Builder create(PositionQualificationContract contract) {
173             if (contract == null) {
174                 throw new IllegalArgumentException("contract was null");
175             }
176 
177             Builder builder = create();
178             builder.setQualificationValue(contract.getQualificationValue());
179             builder.setQualificationType(contract.getQualificationType());
180             builder.setPmQualificationId(contract.getPmQualificationId());
181             builder.setTypeValue(contract.getTypeValue());
182             builder.setQualifier(contract.getQualifier());
183             builder.setHrPositionId(contract.getHrPositionId());
184             builder.setEffectiveLocalDateOfOwner(contract.getEffectiveLocalDateOfOwner());
185             builder.setVersionNumber(contract.getVersionNumber());
186             builder.setObjectId(contract.getObjectId());
187             return builder;
188         }
189 
190         public PositionQualification build() {
191             return new PositionQualification(this);
192         }
193 
194         @Override
195         public String getQualificationValue() {
196             return this.qualificationValue;
197         }
198 
199         @Override
200         public String getQualificationType() {
201             return this.qualificationType;
202         }
203 
204         @Override
205         public String getPmQualificationId() {
206             return this.pmQualificationId;
207         }
208 
209         @Override
210         public String getTypeValue() {
211             return this.typeValue;
212         }
213 
214         @Override
215         public String getQualifier() {
216             return this.qualifier;
217         }
218         
219         @Override
220         public String getHrPositionId() {
221             return this.hrPositionId;
222         }
223 
224         @Override
225         public LocalDate getEffectiveLocalDateOfOwner() {
226             return this.effectiveLocalDateOfOwner;
227         }
228 
229         @Override
230         public Long getVersionNumber() {
231             return this.versionNumber;
232         }
233 
234         @Override
235         public String getObjectId() {
236             return this.objectId;
237         }
238 
239         public void setQualificationValue(String qualificationValue) {
240 
241             this.qualificationValue = qualificationValue;
242         }
243 
244         public void setQualificationType(String qualificationType) {
245 
246             this.qualificationType = qualificationType;
247         }
248 
249         public void setPmQualificationId(String pmQualificationId) {
250 
251             this.pmQualificationId = pmQualificationId;
252         }
253 
254         public void setTypeValue(String typeValue) {
255 
256             this.typeValue = typeValue;
257         }
258 
259         public void setQualifier(String qualifier) {
260 
261             this.qualifier = qualifier;
262         }
263         
264         public void setHrPositionId(String hrPositionId) {
265 
266             this.hrPositionId = hrPositionId;
267         }
268 
269         public void setEffectiveLocalDateOfOwner(LocalDate effectiveLocalDateOfOwner) {
270 
271             this.effectiveLocalDateOfOwner = effectiveLocalDateOfOwner;
272         }
273 
274         public void setVersionNumber(Long versionNumber) {
275 
276             this.versionNumber = versionNumber;
277         }
278 
279         public void setObjectId(String objectId) {
280 
281             this.objectId = objectId;
282         }
283 
284     }
285 
286 
287     /**
288      * Defines some internal constants used on this class.
289      * 
290      */
291     static class Constants {
292 
293         final static String ROOT_ELEMENT_NAME = "positionQualification";
294         final static String TYPE_NAME = "PositionQualificationType";
295 
296     }
297 
298 
299     /**
300      * A private class which exposes constants which define the XML element names to use when this object is marshalled to XML.
301      * 
302      */
303     static class Elements {
304 
305         final static String QUALIFICATION_VALUE = "qualificationValue";
306         final static String QUALIFICATION_TYPE = "qualificationType";
307         final static String PM_QUALIFICATION_ID = "pmQualificationId";
308         final static String TYPE_VALUE = "typeValue";
309         final static String QUALIFIER = "qualifier";
310         final static String HR_POSITION_ID = "hrPositionId";
311         final static String EFFECTIVE_LOCAL_DATE_OF_OWNER = "effectiveLocalDateOfOwner";
312 
313     }
314 
315 }
316