1 | |
|
2 | |
|
3 | |
|
4 | |
|
5 | |
|
6 | |
|
7 | |
|
8 | |
|
9 | |
|
10 | |
|
11 | |
|
12 | |
package org.kuali.student.r2.core.versionmanagement.dto; |
13 | |
|
14 | |
import org.kuali.student.r2.core.versionmanagement.infc.Version; |
15 | |
import org.w3c.dom.Element; |
16 | |
|
17 | |
import javax.xml.bind.annotation.XmlAccessType; |
18 | |
import javax.xml.bind.annotation.XmlAccessorType; |
19 | |
import javax.xml.bind.annotation.XmlAnyElement; |
20 | |
import javax.xml.bind.annotation.XmlElement; |
21 | |
import javax.xml.bind.annotation.XmlType; |
22 | |
import java.io.Serializable; |
23 | |
import java.util.Date; |
24 | |
import java.util.List; |
25 | |
|
26 | |
@XmlAccessorType(XmlAccessType.FIELD) |
27 | |
@XmlType(name = "VersionInfo", propOrder = {"versionIndId", "sequenceNumber", "currentVersionStart", "currentVersionEnd", "versionComment", "versionedFromId", "_futureElements"}) |
28 | |
public class VersionInfo implements Version, Serializable { |
29 | |
|
30 | |
private static final long serialVersionUID = 1L; |
31 | |
|
32 | |
@XmlElement |
33 | |
private String versionIndId; |
34 | |
|
35 | |
@XmlElement |
36 | |
private Long sequenceNumber; |
37 | |
|
38 | |
@XmlElement |
39 | |
private Date currentVersionStart; |
40 | |
|
41 | |
@XmlElement |
42 | |
private Date currentVersionEnd; |
43 | |
|
44 | |
@XmlElement |
45 | |
private String versionComment; |
46 | |
|
47 | |
@XmlElement |
48 | |
private String versionedFromId; |
49 | |
|
50 | |
@XmlAnyElement |
51 | |
private List<Element> _futureElements; |
52 | |
|
53 | 0 | public VersionInfo() { |
54 | |
|
55 | 0 | } |
56 | |
|
57 | 0 | public VersionInfo(Version version) { |
58 | 0 | if (version != null) { |
59 | 0 | this.versionIndId = version.getVersionIndId(); |
60 | 0 | this.sequenceNumber = version.getSequenceNumber(); |
61 | 0 | this.currentVersionStart = (null != version.getCurrentVersionStart()) ? new Date(version.getCurrentVersionStart().getTime()) : null; |
62 | 0 | this.currentVersionEnd = (null != version.getCurrentVersionEnd()) ? new Date(version.getCurrentVersionEnd().getTime()) : null; |
63 | 0 | this.versionComment = version.getVersionComment(); |
64 | 0 | this.versionedFromId = version.getVersionedFromId(); |
65 | |
} |
66 | 0 | } |
67 | |
|
68 | |
@Override |
69 | |
public String getVersionIndId() { |
70 | 0 | return versionIndId; |
71 | |
} |
72 | |
|
73 | |
public void setVersionIndId(String versionIndId) { |
74 | 0 | this.versionIndId = versionIndId; |
75 | 0 | } |
76 | |
|
77 | |
@Override |
78 | |
public Long getSequenceNumber() { |
79 | 0 | return sequenceNumber; |
80 | |
} |
81 | |
|
82 | |
public void setSequenceNumber(Long sequenceNumber) { |
83 | 0 | this.sequenceNumber = sequenceNumber; |
84 | 0 | } |
85 | |
|
86 | |
@Override |
87 | |
public Date getCurrentVersionStart() { |
88 | 0 | return currentVersionStart; |
89 | |
} |
90 | |
|
91 | |
public void setCurrentVersionStart(Date currentVersionStart) { |
92 | 0 | this.currentVersionStart = currentVersionStart; |
93 | 0 | } |
94 | |
|
95 | |
@Override |
96 | |
public Date getCurrentVersionEnd() { |
97 | 0 | return currentVersionEnd; |
98 | |
} |
99 | |
|
100 | |
public void setCurrentVersionEnd(Date currentVersionEnd) { |
101 | 0 | this.currentVersionEnd = currentVersionEnd; |
102 | 0 | } |
103 | |
|
104 | |
@Override |
105 | |
public String getVersionComment() { |
106 | 0 | return versionComment; |
107 | |
} |
108 | |
|
109 | |
public void setVersionComment(String versionComment) { |
110 | 0 | this.versionComment = versionComment; |
111 | 0 | } |
112 | |
|
113 | |
@Override |
114 | |
public String getVersionedFromId() { |
115 | 0 | return versionedFromId; |
116 | |
} |
117 | |
|
118 | |
public void setVersionedFromId(String versionedFromId) { |
119 | 0 | this.versionedFromId = versionedFromId; |
120 | 0 | } |
121 | |
} |