1 | |
|
2 | |
|
3 | |
|
4 | |
|
5 | |
|
6 | |
|
7 | |
|
8 | |
|
9 | |
|
10 | |
|
11 | |
|
12 | |
|
13 | |
|
14 | |
|
15 | |
|
16 | |
package org.kuali.student.r2.lum.clu.dto; |
17 | |
|
18 | |
import org.kuali.student.r2.common.dto.IdNamelessEntityInfo; |
19 | |
import org.kuali.student.r2.common.dto.RichTextInfo; |
20 | |
import org.kuali.student.r2.lum.clu.infc.CluResult; |
21 | |
import org.kuali.student.r2.lum.clu.infc.ResultOption; |
22 | |
|
23 | |
import javax.xml.bind.Element; |
24 | |
import javax.xml.bind.annotation.XmlAccessType; |
25 | |
import javax.xml.bind.annotation.XmlAccessorType; |
26 | |
import javax.xml.bind.annotation.XmlAnyElement; |
27 | |
import javax.xml.bind.annotation.XmlElement; |
28 | |
import javax.xml.bind.annotation.XmlType; |
29 | |
import java.io.Serializable; |
30 | |
import java.util.ArrayList; |
31 | |
import java.util.Date; |
32 | |
import java.util.List; |
33 | |
|
34 | |
@XmlAccessorType(XmlAccessType.FIELD) |
35 | |
@XmlType(name = "CluResultInfo", propOrder = {"id", "descr", "typeKey", "stateKey", "cluId", "resultOptions", "effectiveDate", |
36 | |
"expirationDate", "meta", "attributes", "_futureElements"}) |
37 | |
public class CluResultInfo extends IdNamelessEntityInfo implements Serializable, CluResult { |
38 | |
|
39 | |
private static final long serialVersionUID = 1L; |
40 | |
|
41 | |
@XmlElement |
42 | |
private String cluId; |
43 | |
|
44 | |
@XmlElement |
45 | |
private RichTextInfo descr; |
46 | |
|
47 | |
@XmlElement |
48 | |
private List<ResultOptionInfo> resultOptions; |
49 | |
|
50 | |
@XmlElement |
51 | |
private Date effectiveDate; |
52 | |
|
53 | |
@XmlElement |
54 | |
private Date expirationDate; |
55 | |
|
56 | |
@XmlAnyElement |
57 | |
private List<Element> _futureElements; |
58 | |
|
59 | 0 | public CluResultInfo() { |
60 | |
|
61 | 0 | } |
62 | |
|
63 | |
public CluResultInfo(CluResult cluResult) { |
64 | 0 | super(cluResult); |
65 | 0 | if (null != cluResult) { |
66 | 0 | this.cluId = cluResult.getCluId(); |
67 | 0 | this.resultOptions = new ArrayList<ResultOptionInfo>(); |
68 | 0 | for (ResultOption resultOption : cluResult.getResultOptions()) { |
69 | 0 | this.resultOptions.add(new ResultOptionInfo(resultOption)); |
70 | |
} |
71 | 0 | this.effectiveDate = (null != cluResult.getEffectiveDate()) ? new Date(cluResult.getEffectiveDate().getTime()) : null; |
72 | 0 | this.expirationDate = (null != cluResult.getExpirationDate()) ? new Date(cluResult.getExpirationDate().getTime()) : null; |
73 | |
} |
74 | 0 | } |
75 | |
|
76 | |
@Override |
77 | |
public String getCluId() { |
78 | 0 | return cluId; |
79 | |
} |
80 | |
|
81 | |
public void setCluId(String cluId) { |
82 | 0 | this.cluId = cluId; |
83 | 0 | } |
84 | |
|
85 | |
@Override |
86 | |
public RichTextInfo getDescr() { |
87 | 0 | return descr; |
88 | |
} |
89 | |
|
90 | |
public void setDescr(RichTextInfo descr) { |
91 | 0 | this.descr = descr; |
92 | 0 | } |
93 | |
|
94 | |
@Override |
95 | |
public List<ResultOptionInfo> getResultOptions() { |
96 | 0 | if (resultOptions == null) { |
97 | 0 | resultOptions = new ArrayList<ResultOptionInfo>(0); |
98 | |
} |
99 | 0 | return resultOptions; |
100 | |
} |
101 | |
|
102 | |
public void setResultOptions(List<ResultOptionInfo> resultOptions) { |
103 | 0 | this.resultOptions = resultOptions; |
104 | 0 | } |
105 | |
|
106 | |
@Override |
107 | |
public Date getEffectiveDate() { |
108 | 0 | return effectiveDate; |
109 | |
} |
110 | |
|
111 | |
public void setEffectiveDate(Date effectiveDate) { |
112 | 0 | this.effectiveDate = effectiveDate; |
113 | 0 | } |
114 | |
|
115 | |
@Override |
116 | |
public Date getExpirationDate() { |
117 | 0 | return expirationDate; |
118 | |
} |
119 | |
|
120 | |
public void setExpirationDate(Date expirationDate) { |
121 | 0 | this.expirationDate = expirationDate; |
122 | 0 | } |
123 | |
|
124 | |
@Override |
125 | |
public String toString() { |
126 | 0 | return "CluResultInfo[id=" + this.getId() + ", cluId=" + this.getCluId() + ", type=" + this.getTypeKey() + "]"; |
127 | |
} |
128 | |
} |