1 | |
|
2 | |
|
3 | |
|
4 | |
|
5 | |
|
6 | |
|
7 | |
|
8 | |
|
9 | |
|
10 | |
|
11 | |
|
12 | |
|
13 | |
|
14 | |
|
15 | |
|
16 | |
|
17 | |
package org.kuali.student.r2.core.hold.dto; |
18 | |
|
19 | |
import java.io.Serializable; |
20 | |
import java.util.Date; |
21 | |
import java.util.List; |
22 | |
|
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 | |
|
29 | |
import org.kuali.student.r2.core.hold.infc.Hold; |
30 | |
import org.kuali.student.r2.common.dto.IdEntityInfo; |
31 | |
import org.w3c.dom.Element; |
32 | |
|
33 | |
@XmlAccessorType(XmlAccessType.FIELD) |
34 | |
@XmlType(name = "HoldInfo", propOrder = {"id", "typeKey", "stateKey", "name", |
35 | |
"descr", "issueId", "personId", "effectiveDate", "releasedDate", |
36 | |
"meta", "attributes", "_futureElements"}) |
37 | |
|
38 | |
public class HoldInfo |
39 | |
extends IdEntityInfo |
40 | |
implements Hold, Serializable { |
41 | |
|
42 | |
private static final long serialVersionUID = 1L; |
43 | |
|
44 | |
@XmlElement |
45 | |
private String personId; |
46 | |
|
47 | |
@XmlElement |
48 | |
private String issueId; |
49 | |
|
50 | |
@XmlElement |
51 | |
private Date effectiveDate; |
52 | |
|
53 | |
@XmlElement |
54 | |
private Date releasedDate; |
55 | |
|
56 | |
@XmlAnyElement |
57 | |
private List<Element> _futureElements; |
58 | |
|
59 | |
|
60 | |
|
61 | |
|
62 | |
|
63 | 0 | public HoldInfo() { |
64 | 0 | } |
65 | |
|
66 | |
|
67 | |
|
68 | |
|
69 | |
|
70 | |
|
71 | |
public HoldInfo(Hold hold) { |
72 | 0 | super(hold); |
73 | |
|
74 | 0 | if (hold != null) { |
75 | 0 | this.personId = hold.getPersonId(); |
76 | 0 | this.issueId = hold.getIssueId(); |
77 | |
|
78 | 0 | if (hold.getEffectiveDate() != null) { |
79 | 0 | this.effectiveDate = new Date(hold.getEffectiveDate().getTime()); |
80 | |
} |
81 | 0 | if (hold.getReleasedDate() != null) { |
82 | 0 | this.releasedDate = new Date(hold.getReleasedDate().getTime()); |
83 | |
} |
84 | |
} |
85 | 0 | } |
86 | |
|
87 | |
@Override |
88 | |
public String getPersonId() { |
89 | 0 | return personId; |
90 | |
} |
91 | |
|
92 | |
public void setPersonId(String personId) { |
93 | 0 | this.personId = personId; |
94 | 0 | } |
95 | |
|
96 | |
@Override |
97 | |
public String getIssueId() { |
98 | 0 | return issueId; |
99 | |
} |
100 | |
|
101 | |
public void setIssueId(String issueId) { |
102 | 0 | this.issueId = issueId; |
103 | 0 | } |
104 | |
|
105 | |
@Override |
106 | |
public Date getEffectiveDate() { |
107 | 0 | return effectiveDate != null ? new Date(effectiveDate.getTime()) : null; |
108 | |
} |
109 | |
|
110 | |
public void setEffectiveDate(Date effectiveDate) { |
111 | 0 | if (effectiveDate != null) { |
112 | 0 | this.effectiveDate = new Date(effectiveDate.getTime()); |
113 | |
} |
114 | 0 | } |
115 | |
|
116 | |
@Override |
117 | |
public Date getReleasedDate() { |
118 | 0 | return releasedDate != null ? new Date(releasedDate.getTime()) : null; |
119 | |
} |
120 | |
|
121 | |
public void setReleasedDate(Date releasedDate) { |
122 | 0 | if (releasedDate != null) { |
123 | 0 | this.releasedDate = new Date(releasedDate.getTime()); |
124 | |
} |
125 | 0 | } |
126 | |
} |