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