1 | |
|
2 | |
|
3 | |
|
4 | |
|
5 | |
|
6 | |
|
7 | |
|
8 | |
|
9 | |
|
10 | |
|
11 | |
|
12 | |
|
13 | |
|
14 | |
|
15 | |
|
16 | |
package org.kuali.student.enrollment.acal.dto; |
17 | |
|
18 | |
import java.io.Serializable; |
19 | |
import java.util.ArrayList; |
20 | |
import java.util.Date; |
21 | |
import java.util.List; |
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 | |
|
29 | |
import org.kuali.student.enrollment.acal.infc.AcademicCalendar; |
30 | |
import org.kuali.student.r2.common.dto.IdEntityInfo; |
31 | |
import org.w3c.dom.Element; |
32 | |
|
33 | |
@XmlAccessorType(XmlAccessType.FIELD) |
34 | |
@XmlType(name = "AcademicCalendarInfo", propOrder = { |
35 | |
"id", "typeKey", "stateKey", "name", "descr", |
36 | |
"holidayCalendarIds", "adminOrgId", "startDate", "endDate", |
37 | |
"meta", "attributes", "_futureElements" }) |
38 | |
|
39 | |
public class AcademicCalendarInfo |
40 | |
extends IdEntityInfo |
41 | |
implements AcademicCalendar, Serializable { |
42 | |
|
43 | |
private static final long serialVersionUID = 1L; |
44 | |
|
45 | |
@XmlElement |
46 | |
private List<String> holidayCalendarIds; |
47 | |
|
48 | |
@XmlElement |
49 | |
private String adminOrgId; |
50 | |
|
51 | |
@XmlElement |
52 | |
private Date startDate; |
53 | |
|
54 | |
@XmlElement |
55 | |
private Date endDate; |
56 | |
|
57 | |
@XmlAnyElement |
58 | |
private List<Element> _futureElements; |
59 | |
|
60 | |
|
61 | |
|
62 | |
|
63 | 0 | public AcademicCalendarInfo() { |
64 | 0 | } |
65 | |
|
66 | |
|
67 | |
|
68 | |
|
69 | |
|
70 | |
|
71 | |
public AcademicCalendarInfo(AcademicCalendar acal) { |
72 | 0 | super(acal); |
73 | |
|
74 | 0 | if (acal != null) { |
75 | 0 | if (acal.getHolidayCalendarIds() != null) { |
76 | 0 | this.holidayCalendarIds = new ArrayList<String>(acal.getHolidayCalendarIds()); |
77 | |
} |
78 | 0 | this.adminOrgId = acal.getAdminOrgId(); |
79 | 0 | if (acal.getStartDate() != null) { |
80 | 0 | this.startDate = new Date(acal.getStartDate().getTime()); |
81 | |
} |
82 | |
|
83 | 0 | if (acal.getEndDate() != null) { |
84 | 0 | this.endDate = new Date(acal.getEndDate().getTime()); |
85 | |
} |
86 | 0 | this.adminOrgId = acal.getAdminOrgId(); |
87 | |
|
88 | 0 | this.holidayCalendarIds = new ArrayList<String>(acal.getHolidayCalendarIds()); |
89 | |
} |
90 | 0 | } |
91 | |
|
92 | |
@Override |
93 | |
public List<String> getHolidayCalendarIds() { |
94 | 0 | if (holidayCalendarIds == null) { |
95 | 0 | holidayCalendarIds = new ArrayList<String>(); |
96 | |
} |
97 | |
|
98 | 0 | return holidayCalendarIds; |
99 | |
} |
100 | |
|
101 | |
public void setHolidayCalendarIds(List<String> holidayCalendarIds) { |
102 | 0 | this.holidayCalendarIds = holidayCalendarIds; |
103 | 0 | } |
104 | |
|
105 | |
@Override |
106 | |
public String getAdminOrgId() { |
107 | 0 | return adminOrgId; |
108 | |
} |
109 | |
|
110 | |
public void setAdminOrgId(String adminOrgId) { |
111 | 0 | this.adminOrgId = adminOrgId; |
112 | 0 | } |
113 | |
|
114 | |
@Override |
115 | |
public Date getStartDate() { |
116 | 0 | return startDate; |
117 | |
} |
118 | |
|
119 | |
public void setStartDate(Date startDate) { |
120 | 0 | this.startDate = startDate; |
121 | 0 | } |
122 | |
|
123 | |
@Override |
124 | |
public Date getEndDate() { |
125 | 0 | return endDate; |
126 | |
} |
127 | |
|
128 | |
public void setEndDate(Date endDate) { |
129 | 0 | this.endDate = endDate; |
130 | 0 | } |
131 | |
} |