1 | |
|
2 | |
|
3 | |
|
4 | |
|
5 | |
|
6 | |
|
7 | |
|
8 | |
|
9 | |
|
10 | |
|
11 | |
|
12 | |
|
13 | |
|
14 | |
|
15 | |
|
16 | |
package org.kuali.student.core.academiccalendar.dto; |
17 | |
|
18 | |
import java.io.Serializable; |
19 | |
import java.util.Date; |
20 | |
import java.util.List; |
21 | |
import org.w3c.dom.Element; |
22 | |
|
23 | |
import javax.xml.bind.annotation.XmlAccessType; |
24 | |
import javax.xml.bind.annotation.XmlAccessorType; |
25 | |
import javax.xml.bind.annotation.XmlAnyElement; |
26 | |
import javax.xml.bind.annotation.XmlAttribute; |
27 | |
import javax.xml.bind.annotation.XmlElement; |
28 | |
import javax.xml.bind.annotation.XmlType; |
29 | |
import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter; |
30 | |
|
31 | |
import org.kuali.student.common.infc.ModelBuilder; |
32 | |
import org.kuali.student.r2.common.dto.KeyEntityInfo; |
33 | |
|
34 | |
import org.kuali.student.core.academiccalendar.infc.AcademicCalendar; |
35 | |
|
36 | |
|
37 | |
|
38 | |
|
39 | |
|
40 | |
|
41 | |
|
42 | |
|
43 | |
|
44 | |
@XmlAccessorType(XmlAccessType.FIELD) |
45 | |
@XmlType(name = "AcademicCalendarInfo", propOrder = {"key", "typeKey", "stateKey", "name", "descr", "startDate", "endDate", "campusCalendarKey", "credentialProgramTypeKey", "metaInfo", "attributes", "_futureElements"}) |
46 | |
|
47 | |
public class AcademicCalendarInfo extends KeyEntityInfo implements AcademicCalendar, Serializable { |
48 | |
|
49 | |
private static final long serialVersionUID = 1L; |
50 | |
|
51 | |
@XmlElement |
52 | |
private final Date startDate; |
53 | |
|
54 | |
@XmlElement |
55 | |
private final Date endDate; |
56 | |
|
57 | |
@XmlElement |
58 | |
private final String campusCalendarKey; |
59 | |
|
60 | |
@XmlElement |
61 | |
private final String credentialProgramTypeKey; |
62 | |
|
63 | |
@XmlAnyElement |
64 | |
private final List<Element> _futureElements; |
65 | |
|
66 | 0 | private AcademicCalendarInfo() { |
67 | 0 | startDate = null; |
68 | 0 | endDate = null; |
69 | 0 | campusCalendarKey = null; |
70 | 0 | credentialProgramTypeKey = null; |
71 | 0 | _futureElements = null; |
72 | 0 | } |
73 | |
|
74 | |
|
75 | |
|
76 | |
|
77 | |
|
78 | |
|
79 | |
|
80 | |
public AcademicCalendarInfo(AcademicCalendar academicCalendar) { |
81 | 0 | super(academicCalendar); |
82 | |
|
83 | 0 | this.startDate = null != academicCalendar.getStartDate() ? new Date(academicCalendar.getStartDate().getTime()) : null; |
84 | 0 | this.endDate = null != academicCalendar.getEndDate() ? new Date(academicCalendar.getEndDate().getTime()) : null; |
85 | 0 | this.campusCalendarKey = academicCalendar.getCampusCalendarKey(); |
86 | 0 | this.credentialProgramTypeKey = academicCalendar.getCredentialProgramTypeKey(); |
87 | |
|
88 | 0 | _futureElements = null; |
89 | 0 | } |
90 | |
|
91 | |
|
92 | |
|
93 | |
|
94 | |
|
95 | |
|
96 | |
|
97 | |
|
98 | |
|
99 | |
|
100 | |
|
101 | |
@Override |
102 | |
public Date getStartDate() { |
103 | 0 | return startDate; |
104 | |
} |
105 | |
|
106 | |
|
107 | |
|
108 | |
|
109 | |
|
110 | |
|
111 | |
|
112 | |
|
113 | |
|
114 | |
|
115 | |
|
116 | |
|
117 | |
|
118 | |
@Override |
119 | |
public Date getEndDate() { |
120 | 0 | return endDate; |
121 | |
} |
122 | |
|
123 | |
|
124 | |
|
125 | |
|
126 | |
|
127 | |
@Override |
128 | |
public String getCampusCalendarKey() { |
129 | 0 | return campusCalendarKey; |
130 | |
} |
131 | |
|
132 | |
|
133 | |
|
134 | |
|
135 | |
|
136 | |
public String getCredentialProgramTypeKey() { |
137 | 0 | return credentialProgramTypeKey; |
138 | |
} |
139 | |
|
140 | |
|
141 | |
|
142 | |
|
143 | 0 | public static class Builder extends KeyEntityInfo.Builder implements ModelBuilder<AcademicCalendarInfo>, AcademicCalendar { |
144 | |
|
145 | |
private Date startDate; |
146 | |
private Date endDate; |
147 | |
private String campusCalendarKey; |
148 | |
private String credentialProgramTypeKey; |
149 | |
|
150 | |
|
151 | |
|
152 | |
|
153 | |
|
154 | 0 | public Builder() {} |
155 | |
|
156 | |
|
157 | |
|
158 | |
|
159 | |
public Builder(AcademicCalendar academicCalendar) { |
160 | 0 | super(academicCalendar); |
161 | |
|
162 | 0 | this.startDate = academicCalendar.getStartDate(); |
163 | 0 | this.endDate = academicCalendar.getEndDate(); |
164 | 0 | this.campusCalendarKey = academicCalendar.getCampusCalendarKey(); |
165 | 0 | this.credentialProgramTypeKey = academicCalendar.getCredentialProgramTypeKey(); |
166 | 0 | } |
167 | |
|
168 | |
|
169 | |
|
170 | |
|
171 | |
|
172 | |
|
173 | |
public AcademicCalendarInfo build() { |
174 | 0 | return new AcademicCalendarInfo(this); |
175 | |
} |
176 | |
|
177 | |
|
178 | |
|
179 | |
|
180 | |
|
181 | |
|
182 | |
@Override |
183 | |
public Date getStartDate() { |
184 | 0 | return startDate; |
185 | |
} |
186 | |
|
187 | |
|
188 | |
|
189 | |
|
190 | |
|
191 | |
|
192 | |
public void setStartDate(Date startDate) { |
193 | 0 | this.startDate = startDate; |
194 | 0 | } |
195 | |
|
196 | |
|
197 | |
|
198 | |
|
199 | |
|
200 | |
|
201 | |
@Override |
202 | |
public Date getEndDate() { |
203 | 0 | return endDate; |
204 | |
} |
205 | |
|
206 | |
|
207 | |
|
208 | |
|
209 | |
|
210 | |
|
211 | |
|
212 | |
public void setEndDate(Date endDate) { |
213 | 0 | this.endDate = endDate; |
214 | 0 | } |
215 | |
|
216 | |
|
217 | |
|
218 | |
|
219 | |
|
220 | |
public String getCampusCalendarKey() { |
221 | 0 | return campusCalendarKey; |
222 | |
} |
223 | |
|
224 | |
public void setCampusCalendarKey(String campusCalendarKey) { |
225 | 0 | this.campusCalendarKey = campusCalendarKey; |
226 | 0 | } |
227 | |
|
228 | |
|
229 | |
|
230 | |
|
231 | |
|
232 | |
public String getCredentialProgramTypeKey() { |
233 | 0 | return credentialProgramTypeKey; |
234 | |
} |
235 | |
|
236 | |
public void setCredentialProgramTypeKey(String credentialProgramTypeKey) { |
237 | 0 | this.credentialProgramTypeKey = credentialProgramTypeKey; |
238 | 0 | } |
239 | |
} |
240 | |
} |