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 | |
|
31 | |
import org.kuali.student.enrollment.classII.academiccalendar.infc.KeyDate; |
32 | |
|
33 | |
@XmlAccessorType(XmlAccessType.FIELD) |
34 | |
@XmlType(name = "KeyDateInfo", propOrder = {"key", "typeKey", "stateKey", "name", "descr", "isAllDay", "isDateRange", "startDate", "endDate", "metaInfo", "attributes", "_futureElements"}) |
35 | |
public class KeyDateInfo extends KeyEntityInfo implements KeyDate, Serializable { |
36 | |
|
37 | |
private static final long serialVersionUID = 1L; |
38 | |
@XmlElement |
39 | |
private final Boolean isAllDay; |
40 | |
@XmlElement |
41 | |
private final Boolean isDateRange; |
42 | |
@XmlElement |
43 | |
private final Date startDate; |
44 | |
@XmlElement |
45 | |
private final Date endDate; |
46 | |
@XmlAnyElement |
47 | |
private final List<Element> _futureElements; |
48 | |
|
49 | 0 | protected KeyDateInfo() { |
50 | 0 | isAllDay = false; |
51 | 0 | isDateRange = false; |
52 | 0 | startDate = null; |
53 | 0 | endDate = null; |
54 | 0 | _futureElements = null; |
55 | 0 | } |
56 | |
|
57 | |
|
58 | |
|
59 | |
|
60 | |
|
61 | |
|
62 | |
public KeyDateInfo(KeyDate keyDate) { |
63 | 0 | super(keyDate); |
64 | 0 | this.isAllDay = keyDate.getIsAllDay(); |
65 | 0 | this.isDateRange = keyDate.getIsDateRange(); |
66 | 0 | this.startDate = null != keyDate.getStartDate() ? new Date(keyDate.getStartDate().getTime()) : null; |
67 | 0 | this.endDate = null != keyDate.getEndDate() ? new Date(keyDate.getEndDate().getTime()) : null; |
68 | 0 | _futureElements = null; |
69 | 0 | } |
70 | |
|
71 | |
@Override |
72 | |
public Boolean getIsAllDay() { |
73 | 0 | return isAllDay; |
74 | |
} |
75 | |
|
76 | |
@Override |
77 | |
public Boolean getIsDateRange() { |
78 | 0 | return isDateRange; |
79 | |
} |
80 | |
|
81 | |
@Override |
82 | |
public Date getStartDate() { |
83 | 0 | return startDate; |
84 | |
} |
85 | |
|
86 | |
@Override |
87 | |
public Date getEndDate() { |
88 | 0 | return endDate; |
89 | |
} |
90 | |
|
91 | |
|
92 | |
|
93 | |
|
94 | 0 | public static class Builder extends KeyEntityInfo.Builder implements ModelBuilder<KeyDateInfo>, KeyDate { |
95 | |
|
96 | |
private Boolean isAllDay; |
97 | |
private Boolean isDateRange; |
98 | |
private Date startDate; |
99 | |
private Date endDate; |
100 | |
|
101 | |
|
102 | |
|
103 | |
|
104 | 0 | public Builder() { |
105 | 0 | } |
106 | |
|
107 | |
|
108 | |
|
109 | |
|
110 | |
|
111 | |
public Builder(KeyDate keyDate) { |
112 | 0 | super(keyDate); |
113 | 0 | this.isAllDay = keyDate.getIsAllDay(); |
114 | 0 | this.isDateRange = keyDate.getIsDateRange(); |
115 | 0 | this.startDate = null != keyDate.getStartDate() ? new Date(keyDate.getStartDate().getTime()) : null; |
116 | 0 | this.endDate = null != keyDate.getEndDate() ? new Date(keyDate.getEndDate().getTime()) : null; |
117 | 0 | } |
118 | |
|
119 | |
@Override |
120 | |
public KeyDateInfo build() { |
121 | 0 | return new KeyDateInfo(this); |
122 | |
} |
123 | |
|
124 | |
@Override |
125 | |
public Boolean getIsAllDay() { |
126 | 0 | return isAllDay; |
127 | |
} |
128 | |
|
129 | |
public void setIsAllDay(Boolean isAllDay) { |
130 | 0 | this.isAllDay = isAllDay; |
131 | 0 | } |
132 | |
|
133 | |
@Override |
134 | |
public Boolean getIsDateRange() { |
135 | 0 | return isDateRange; |
136 | |
} |
137 | |
|
138 | |
public void setIsDateRange(Boolean isDateRange) { |
139 | 0 | this.isDateRange = isDateRange; |
140 | 0 | } |
141 | |
|
142 | |
@Override |
143 | |
public Date getStartDate() { |
144 | 0 | return startDate; |
145 | |
} |
146 | |
|
147 | |
public void setStartDate(Date startDate) { |
148 | 0 | this.startDate = new Date(startDate.getTime()); |
149 | 0 | } |
150 | |
|
151 | |
@Override |
152 | |
public Date getEndDate() { |
153 | 0 | return endDate; |
154 | |
} |
155 | |
|
156 | |
public void setEndDate(Date endDate) { |
157 | 0 | this.endDate = new Date(endDate.getTime()); |
158 | 0 | } |
159 | |
} |
160 | |
} |