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.common.dto.KeyEntityInfo; |
33 | |
import org.kuali.student.core.academiccalendar.infc.HolidayInfc; |
34 | |
|
35 | |
import org.kuali.student.core.ws.binding.JaxbAttributeMapListAdapter; |
36 | |
|
37 | |
|
38 | |
|
39 | |
|
40 | |
|
41 | |
|
42 | |
|
43 | |
|
44 | |
|
45 | |
@XmlAccessorType(XmlAccessType.FIELD) |
46 | |
@XmlType(name = "HolidayInfo", propOrder = {"key", "typeKey", "stateKey", "name", "descr", "isDateRange", "startDate", "endDate", "isInstructionalDay", "isExamDay", "metaInfo", "attributes", "_futureElements"}) |
47 | |
|
48 | |
public class HolidayInfo extends KeyEntityInfo implements HolidayInfc, Serializable { |
49 | |
|
50 | |
private static final long serialVersionUID = 1L; |
51 | |
|
52 | |
@XmlElement |
53 | |
private final Boolean isDateRange; |
54 | |
|
55 | |
@XmlElement |
56 | |
private final Date startDate; |
57 | |
|
58 | |
@XmlElement |
59 | |
private final Date endDate; |
60 | |
|
61 | |
@XmlElement |
62 | |
private final Boolean isInstructionalDay; |
63 | |
|
64 | |
@XmlElement |
65 | |
private final Boolean isExamDay; |
66 | |
|
67 | |
@XmlAnyElement |
68 | |
private final List<Element> _futureElements; |
69 | |
|
70 | 0 | private HolidayInfo() { |
71 | 0 | isDateRange = false; |
72 | 0 | startDate = null; |
73 | 0 | endDate = null; |
74 | 0 | isInstructionalDay = false; |
75 | 0 | isExamDay = false; |
76 | 0 | _futureElements = null; |
77 | 0 | } |
78 | |
|
79 | |
|
80 | |
|
81 | |
|
82 | |
|
83 | |
|
84 | |
public HolidayInfo(HolidayInfc holiday) { |
85 | 0 | super(holiday); |
86 | 0 | this.isDateRange = holiday.getIsDateRange(); |
87 | 0 | this.startDate = null != holiday.getStartDate() ? new Date(holiday.getStartDate().getTime()) : null; |
88 | 0 | this.endDate = null != holiday.getEndDate() ? new Date(holiday.getEndDate().getTime()) : null; |
89 | 0 | this.isInstructionalDay = holiday.getIsInstructionalDay(); |
90 | 0 | this.isExamDay = holiday.getIsExamDay(); |
91 | 0 | _futureElements = null; |
92 | 0 | } |
93 | |
|
94 | |
|
95 | |
|
96 | |
|
97 | |
|
98 | |
|
99 | |
|
100 | |
|
101 | |
|
102 | |
@Override |
103 | |
public Boolean getIsDateRange() { |
104 | 0 | return isDateRange; |
105 | |
} |
106 | |
|
107 | |
|
108 | |
|
109 | |
|
110 | |
|
111 | |
|
112 | |
|
113 | |
@Override |
114 | |
public Date getStartDate() { |
115 | 0 | return startDate; |
116 | |
} |
117 | |
|
118 | |
|
119 | |
|
120 | |
|
121 | |
|
122 | |
|
123 | |
|
124 | |
@Override |
125 | |
public Date getEndDate() { |
126 | 0 | return endDate; |
127 | |
} |
128 | |
|
129 | |
|
130 | |
|
131 | |
|
132 | |
|
133 | |
|
134 | |
|
135 | |
|
136 | |
@Override |
137 | |
public Boolean getIsInstructionalDay() { |
138 | 0 | return isInstructionalDay; |
139 | |
} |
140 | |
|
141 | |
|
142 | |
|
143 | |
|
144 | |
|
145 | |
|
146 | |
|
147 | |
@Override |
148 | |
public Boolean getIsExamDay() { |
149 | 0 | return isExamDay; |
150 | |
} |
151 | |
|
152 | |
|
153 | |
|
154 | |
|
155 | 0 | public static class Builder extends KeyEntityInfo.Builder implements ModelBuilder<HolidayInfo>, HolidayInfc { |
156 | |
|
157 | |
private Boolean isDateRange; |
158 | |
private Date startDate; |
159 | |
private Date endDate; |
160 | |
private Boolean isInstructionalDay; |
161 | |
private Boolean isExamDay; |
162 | |
|
163 | |
|
164 | |
|
165 | |
|
166 | 0 | public Builder() { |
167 | 0 | } |
168 | |
|
169 | |
|
170 | |
|
171 | |
|
172 | |
|
173 | |
public Builder(HolidayInfc holiday) { |
174 | 0 | super(holiday); |
175 | 0 | this.isDateRange = holiday.getIsDateRange(); |
176 | 0 | this.startDate = null != holiday.getStartDate() ? new Date(holiday.getStartDate().getTime()) : null; |
177 | 0 | this.endDate = null != holiday.getEndDate() ? new Date(holiday.getEndDate().getTime()) : null; |
178 | 0 | this.isInstructionalDay = holiday.getIsInstructionalDay(); |
179 | 0 | this.isExamDay = holiday.getIsExamDay(); |
180 | 0 | } |
181 | |
|
182 | |
|
183 | |
|
184 | |
|
185 | |
|
186 | |
|
187 | |
public HolidayInfo build() { |
188 | 0 | return new HolidayInfo(this); |
189 | |
} |
190 | |
|
191 | |
|
192 | |
|
193 | |
|
194 | |
|
195 | |
|
196 | |
|
197 | |
|
198 | |
@Override |
199 | |
public Boolean getIsDateRange() { |
200 | 0 | return isDateRange; |
201 | |
} |
202 | |
|
203 | |
|
204 | |
|
205 | |
|
206 | |
|
207 | |
|
208 | |
|
209 | |
|
210 | |
|
211 | |
public void dateRange(Boolean isDateRange) { |
212 | 0 | this.isDateRange = isDateRange; |
213 | 0 | } |
214 | |
|
215 | |
|
216 | |
|
217 | |
|
218 | |
|
219 | |
|
220 | |
@Override |
221 | |
public Date getStartDate() { |
222 | 0 | return startDate; |
223 | |
} |
224 | |
|
225 | |
|
226 | |
|
227 | |
|
228 | |
|
229 | |
|
230 | |
public void setStartDate(Date startDate) { |
231 | 0 | this.startDate = new Date(startDate.getTime()); |
232 | 0 | } |
233 | |
|
234 | |
|
235 | |
|
236 | |
|
237 | |
|
238 | |
|
239 | |
@Override |
240 | |
public Date getEndDate() { |
241 | 0 | return endDate; |
242 | |
} |
243 | |
|
244 | |
|
245 | |
|
246 | |
|
247 | |
|
248 | |
|
249 | |
public void setEndDate(Date endDate) { |
250 | 0 | this.endDate = new Date(endDate.getTime()); |
251 | 0 | } |
252 | |
|
253 | |
|
254 | |
|
255 | |
|
256 | |
|
257 | |
|
258 | |
|
259 | |
public Boolean getIsInstructionalDay() { |
260 | 0 | return isInstructionalDay; |
261 | |
} |
262 | |
|
263 | |
public void setIsInstructionalDay(Boolean isInstructionalDay) { |
264 | 0 | this.isInstructionalDay = isInstructionalDay; |
265 | 0 | } |
266 | |
|
267 | |
|
268 | |
|
269 | |
|
270 | |
|
271 | |
|
272 | |
|
273 | |
public Boolean getIsExamDay() { |
274 | 0 | return isExamDay; |
275 | |
} |
276 | |
|
277 | |
public void setIsExamDay(Boolean isExamDay) { |
278 | 0 | this.isExamDay = isExamDay; |
279 | 0 | } |
280 | |
} |
281 | |
} |