1 | |
|
2 | |
|
3 | |
|
4 | |
|
5 | |
|
6 | |
|
7 | |
|
8 | |
|
9 | |
|
10 | |
|
11 | |
|
12 | |
|
13 | |
|
14 | |
|
15 | |
package org.kuali.student.r2.core.enumerationmanagement.dto; |
16 | |
|
17 | |
import org.kuali.student.r2.common.dto.KeyEntityInfo; |
18 | |
import org.kuali.student.r2.core.enumerationmanagement.infc.Enumeration; |
19 | |
|
20 | |
import javax.xml.bind.Element; |
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 | |
import java.io.Serializable; |
27 | |
import java.util.ArrayList; |
28 | |
import java.util.Date; |
29 | |
import java.util.List; |
30 | |
|
31 | |
@XmlAccessorType(XmlAccessType.FIELD) |
32 | |
@XmlType(name = "EnumerationInfo", propOrder = {"key", "typeKey", "stateKey", |
33 | |
"name", "descr", |
34 | |
"contextDescriptors", |
35 | |
"effectiveDate", |
36 | |
"expirationDate", |
37 | |
"meta", "attributes", "_futureElements"}) |
38 | |
public class EnumerationInfo extends KeyEntityInfo implements Enumeration, Serializable { |
39 | |
|
40 | |
private static final long serialVersionUID = 1L; |
41 | |
@XmlElement |
42 | |
private List<String> contextDescriptors; |
43 | |
@XmlElement |
44 | |
private Date effectiveDate; |
45 | |
@XmlElement |
46 | |
private Date expirationDate; |
47 | |
@XmlAnyElement |
48 | |
private List<Element> _futureElements; |
49 | |
|
50 | 0 | public EnumerationInfo() { |
51 | 0 | } |
52 | |
|
53 | |
public EnumerationInfo(Enumeration enumeration) { |
54 | 0 | super(enumeration); |
55 | 0 | if (null != enumeration) { |
56 | 0 | this.contextDescriptors = new ArrayList<String>(enumeration.getContextDescriptors()); |
57 | |
} |
58 | 0 | if (enumeration.getEffectiveDate() != null) { |
59 | 0 | this.effectiveDate = new Date(enumeration.getEffectiveDate().getTime()); |
60 | |
} |
61 | 0 | if (enumeration.getExpirationDate() != null) { |
62 | 0 | this.expirationDate = new Date(enumeration.getExpirationDate().getTime()); |
63 | |
} |
64 | 0 | } |
65 | |
|
66 | |
@Override |
67 | |
public List<String> getContextDescriptors() { |
68 | 0 | if (contextDescriptors == null) { |
69 | 0 | contextDescriptors = new ArrayList<String>(); |
70 | |
} |
71 | 0 | return contextDescriptors; |
72 | |
} |
73 | |
|
74 | |
public void setContextDescriptors(List<String> contextDescriptors) { |
75 | 0 | this.contextDescriptors = contextDescriptors; |
76 | 0 | } |
77 | |
|
78 | |
@Override |
79 | |
public Date getEffectiveDate() { |
80 | 0 | return effectiveDate; |
81 | |
} |
82 | |
|
83 | |
public void setEffectiveDate(Date effectiveDate) { |
84 | 0 | this.effectiveDate = effectiveDate; |
85 | 0 | } |
86 | |
|
87 | |
@Override |
88 | |
public Date getExpirationDate() { |
89 | 0 | return expirationDate; |
90 | |
} |
91 | |
|
92 | |
public void setExpirationDate(Date expirationDate) { |
93 | 0 | this.expirationDate = expirationDate; |
94 | 0 | } |
95 | |
} |