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