1 | |
|
2 | |
|
3 | |
|
4 | |
|
5 | |
|
6 | |
|
7 | |
|
8 | |
|
9 | |
|
10 | |
|
11 | |
|
12 | |
|
13 | |
|
14 | |
|
15 | |
package org.kuali.student.enrollment.classII.academiccalendar.dto; |
16 | |
|
17 | |
import java.io.Serializable; |
18 | |
import java.util.Date; |
19 | |
import java.util.List; |
20 | |
import org.w3c.dom.Element; |
21 | |
|
22 | |
import javax.xml.bind.annotation.XmlAccessType; |
23 | |
import javax.xml.bind.annotation.XmlAccessorType; |
24 | |
import javax.xml.bind.annotation.XmlAnyElement; |
25 | |
import javax.xml.bind.annotation.XmlElement; |
26 | |
import javax.xml.bind.annotation.XmlType; |
27 | |
|
28 | |
import org.kuali.student.r2.common.dto.KeyEntityInfo; |
29 | |
import org.kuali.student.r2.common.infc.ModelBuilder; |
30 | |
import org.kuali.student.enrollment.classII.academiccalendar.infc.Holiday; |
31 | |
|
32 | |
@XmlAccessorType(XmlAccessType.FIELD) |
33 | |
@XmlType(name = "HolidayInfo", propOrder = {"key", "typeKey", "stateKey", "name", "descr", "isInstructionalDay", "isAllDay", "isDateRange", "startDate", "endDate", "metaInfo", "attributes", "_futureElements"}) |
34 | |
public class HolidayInfo extends KeyEntityInfo implements Holiday, Serializable { |
35 | |
|
36 | |
private static final long serialVersionUID = 1L; |
37 | |
@XmlElement |
38 | |
private final Boolean isInstructionalDay; |
39 | |
@XmlElement |
40 | |
private final Boolean isAllDay; |
41 | |
@XmlElement |
42 | |
private final Boolean isDateRange; |
43 | |
@XmlElement |
44 | |
private final Date startDate; |
45 | |
@XmlElement |
46 | |
private final Date endDate; |
47 | |
@XmlAnyElement |
48 | |
private final List<Element> _futureElements; |
49 | |
|
50 | 0 | protected HolidayInfo() { |
51 | 0 | isInstructionalDay = false; |
52 | 0 | isAllDay = false; |
53 | 0 | isDateRange = false; |
54 | 0 | startDate = null; |
55 | 0 | endDate = null; |
56 | 0 | _futureElements = null; |
57 | 0 | } |
58 | |
|
59 | |
|
60 | |
|
61 | |
|
62 | |
|
63 | |
|
64 | |
public HolidayInfo(Holiday holiday) { |
65 | 0 | super(holiday); |
66 | 0 | this.isInstructionalDay = holiday.getIsInstructionalDay(); |
67 | 0 | this.isAllDay = holiday.getIsAllDay(); |
68 | 0 | this.isDateRange = holiday.getIsDateRange(); |
69 | 0 | this.startDate = null != holiday.getStartDate() ? new Date(holiday.getStartDate().getTime()) : null; |
70 | 0 | this.endDate = null != holiday.getEndDate() ? new Date(holiday.getEndDate().getTime()) : null; |
71 | 0 | _futureElements = null; |
72 | 0 | } |
73 | |
|
74 | |
@Override |
75 | |
public Boolean getIsInstructionalDay() { |
76 | 0 | return isInstructionalDay; |
77 | |
} |
78 | |
|
79 | |
@Override |
80 | |
public Boolean getIsAllDay() { |
81 | 0 | return isAllDay; |
82 | |
} |
83 | |
|
84 | |
@Override |
85 | |
public Boolean getIsDateRange() { |
86 | 0 | return isDateRange; |
87 | |
} |
88 | |
|
89 | |
@Override |
90 | |
public Date getStartDate() { |
91 | 0 | return startDate; |
92 | |
} |
93 | |
|
94 | |
@Override |
95 | |
public Date getEndDate() { |
96 | 0 | return endDate; |
97 | |
} |
98 | |
|
99 | |
|
100 | |
|
101 | |
|
102 | 0 | public static class Builder extends KeyEntityInfo.Builder implements ModelBuilder<HolidayInfo>, Holiday { |
103 | |
|
104 | |
private Boolean isInstructionalDay; |
105 | |
private Boolean isAllDay; |
106 | |
private Boolean isDateRange; |
107 | |
private Date startDate; |
108 | |
private Date endDate; |
109 | |
|
110 | |
|
111 | |
|
112 | |
|
113 | 0 | public Builder() { |
114 | 0 | } |
115 | |
|
116 | |
|
117 | |
|
118 | |
|
119 | |
|
120 | |
public Builder(Holiday holiday) { |
121 | 0 | super(holiday); |
122 | 0 | this.isInstructionalDay = holiday.getIsInstructionalDay(); |
123 | 0 | this.isAllDay = holiday.getIsAllDay(); |
124 | 0 | this.isDateRange = holiday.getIsDateRange(); |
125 | 0 | this.startDate = null != holiday.getStartDate() ? new Date(holiday.getStartDate().getTime()) : null; |
126 | 0 | this.endDate = null != holiday.getEndDate() ? new Date(holiday.getEndDate().getTime()) : null; |
127 | 0 | } |
128 | |
|
129 | |
@Override |
130 | |
public HolidayInfo build() { |
131 | 0 | return new HolidayInfo(this); |
132 | |
} |
133 | |
|
134 | |
@Override |
135 | |
public Boolean getIsInstructionalDay() { |
136 | 0 | return isInstructionalDay; |
137 | |
} |
138 | |
|
139 | |
public void setIsInstructionalDay(Boolean isInstructionalDay) { |
140 | 0 | this.isInstructionalDay = isInstructionalDay; |
141 | 0 | } |
142 | |
|
143 | |
@Override |
144 | |
public Boolean getIsAllDay() { |
145 | 0 | return isAllDay; |
146 | |
} |
147 | |
|
148 | |
public void setIsAllDay(Boolean isAllDay) { |
149 | 0 | this.isAllDay = isAllDay; |
150 | 0 | } |
151 | |
|
152 | |
@Override |
153 | |
public Boolean getIsDateRange() { |
154 | 0 | return isDateRange; |
155 | |
} |
156 | |
|
157 | |
public void setIsDateRange(Boolean isDateRange) { |
158 | 0 | this.isDateRange = isDateRange; |
159 | 0 | } |
160 | |
|
161 | |
@Override |
162 | |
public Date getStartDate() { |
163 | 0 | return startDate; |
164 | |
} |
165 | |
|
166 | |
public void setStartDate(Date startDate) { |
167 | 0 | this.startDate = new Date(startDate.getTime()); |
168 | 0 | } |
169 | |
|
170 | |
@Override |
171 | |
public Date getEndDate() { |
172 | 0 | return endDate; |
173 | |
} |
174 | |
|
175 | |
public void setEndDate(Date endDate) { |
176 | 0 | this.endDate = new Date(endDate.getTime()); |
177 | 0 | } |
178 | |
} |
179 | |
} |