1 | |
|
2 | |
|
3 | |
|
4 | |
|
5 | |
|
6 | |
|
7 | |
|
8 | |
|
9 | |
|
10 | |
|
11 | |
|
12 | |
|
13 | |
|
14 | |
|
15 | |
|
16 | |
package org.kuali.student.r2.core.scheduling.dto; |
17 | |
|
18 | |
import org.kuali.student.r2.common.dto.IdEntityInfo; |
19 | |
import org.kuali.student.r2.common.dto.TimeOfDayInfo; |
20 | |
import org.kuali.student.r2.core.scheduling.infc.TimeSlot; |
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.XmlElement; |
27 | |
import javax.xml.bind.annotation.XmlType; |
28 | |
import java.io.Serializable; |
29 | |
import java.util.ArrayList; |
30 | |
import java.util.List; |
31 | |
|
32 | |
|
33 | |
|
34 | |
|
35 | |
|
36 | |
@XmlAccessorType(XmlAccessType.FIELD) |
37 | |
@XmlType(name = "TimeSlotInfo", propOrder = {"id", "typeKey", "stateKey", "name", "descr", |
38 | |
"weekdays", "startTime", "endTime", |
39 | |
"meta", "attributes", "_futureElements"}) |
40 | |
public class TimeSlotInfo extends IdEntityInfo implements TimeSlot, Serializable { |
41 | |
|
42 | |
@XmlElement |
43 | |
private List<Integer> weekdays; |
44 | |
@XmlElement |
45 | |
private TimeOfDayInfo startTime; |
46 | |
@XmlElement |
47 | |
private TimeOfDayInfo endTime; |
48 | |
@XmlAnyElement |
49 | |
private List<Element> _futureElements; |
50 | |
|
51 | 0 | public TimeSlotInfo() { |
52 | 0 | } |
53 | |
|
54 | |
public TimeSlotInfo(TimeSlot timeSlot) { |
55 | 0 | super (timeSlot); |
56 | 0 | if (null != timeSlot) { |
57 | 0 | this.weekdays = new ArrayList<Integer>(timeSlot.getWeekdays()); |
58 | 0 | this.startTime = (null != timeSlot.getStartTime()) ? new TimeOfDayInfo(timeSlot.getStartTime()) : null; |
59 | 0 | this.endTime = (null != timeSlot.getEndTime()) ? new TimeOfDayInfo(timeSlot.getEndTime()) : null; |
60 | |
} |
61 | 0 | } |
62 | |
|
63 | |
@Override |
64 | |
public List<Integer> getWeekdays() { |
65 | 0 | if (null == this.weekdays) { |
66 | 0 | return new ArrayList<Integer>(); |
67 | |
} |
68 | |
else { |
69 | 0 | return this.weekdays; |
70 | |
} |
71 | |
} |
72 | |
|
73 | |
public void setWeekdays(List<Integer> weekdays) { |
74 | 0 | this.weekdays = weekdays; |
75 | 0 | } |
76 | |
|
77 | |
@Override |
78 | |
public TimeOfDayInfo getStartTime() { |
79 | 0 | return startTime; |
80 | |
} |
81 | |
|
82 | |
public void setStartTime(TimeOfDayInfo startTime) { |
83 | 0 | this.startTime = startTime; |
84 | 0 | } |
85 | |
|
86 | |
@Override |
87 | |
public TimeOfDayInfo getEndTime() { |
88 | 0 | return endTime; |
89 | |
} |
90 | |
|
91 | |
public void setEndTime(TimeOfDayInfo endTime) { |
92 | 0 | this.endTime = endTime; |
93 | 0 | } |
94 | |
} |