1 | |
|
2 | |
|
3 | |
|
4 | |
|
5 | |
|
6 | |
|
7 | |
|
8 | |
|
9 | |
|
10 | |
|
11 | |
|
12 | |
|
13 | |
|
14 | |
|
15 | |
package org.kuali.student.common.dto; |
16 | |
|
17 | |
import java.io.Serializable; |
18 | |
import java.util.Date; |
19 | |
import java.util.List; |
20 | |
|
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 | |
|
27 | |
import org.kuali.student.common.infc.Meta; |
28 | |
import org.kuali.student.common.infc.ModelBuilder; |
29 | |
import org.w3c.dom.Element; |
30 | |
|
31 | |
@XmlAccessorType(XmlAccessType.FIELD) |
32 | |
@XmlType(name = "MetaInfo", propOrder = {"versionInd", "createTime", "createId", "updateTime", "updateId", "_futureElements"}) |
33 | 0 | public class MetaInfo implements Meta, Serializable { |
34 | |
|
35 | |
private static final long serialVersionUID = 1L; |
36 | |
@XmlElement |
37 | |
private final String versionInd; |
38 | |
@XmlElement |
39 | |
private final Date createTime; |
40 | |
@XmlElement |
41 | |
private final String createId; |
42 | |
@XmlElement |
43 | |
private final Date updateTime; |
44 | |
@XmlElement |
45 | |
private final String updateId; |
46 | |
@XmlAnyElement |
47 | |
private final List<Element> _futureElements; |
48 | |
|
49 | 0 | private MetaInfo() { |
50 | 0 | versionInd = null; |
51 | 0 | createTime = null; |
52 | 0 | createId = null; |
53 | 0 | updateTime = null; |
54 | 0 | updateId = null; |
55 | 0 | _futureElements = null; |
56 | 0 | } |
57 | |
|
58 | 0 | private MetaInfo(Meta builder) { |
59 | 0 | this.versionInd = builder.getVersionInd(); |
60 | 0 | this.createTime = null != builder.getCreateTime() ? new Date(builder.getCreateTime().getTime()) : null; |
61 | 0 | this.createId = builder.getCreateId(); |
62 | 0 | this.updateTime = null != builder.getUpdateTime() ? new Date(builder.getUpdateTime().getTime()) : null; |
63 | 0 | this.updateId = builder.getUpdateId(); |
64 | 0 | this._futureElements = null; |
65 | 0 | } |
66 | |
|
67 | |
@Override |
68 | |
public String getVersionInd() { |
69 | 0 | return versionInd; |
70 | |
} |
71 | |
|
72 | |
@Override |
73 | |
public Date getCreateTime() { |
74 | 0 | return createTime; |
75 | |
} |
76 | |
|
77 | |
@Override |
78 | |
public String getCreateId() { |
79 | 0 | return createId; |
80 | |
} |
81 | |
|
82 | |
@Override |
83 | |
public Date getUpdateTime() { |
84 | 0 | return updateTime; |
85 | |
} |
86 | |
|
87 | |
@Override |
88 | |
public String getUpdateId() { |
89 | 0 | return updateId; |
90 | |
} |
91 | |
|
92 | 0 | public static class Builder implements ModelBuilder<MetaInfo>, Meta { |
93 | |
|
94 | |
private String versionInd; |
95 | |
private Date createTime; |
96 | |
private String createId; |
97 | |
private Date updateTime; |
98 | |
private String updateId; |
99 | |
|
100 | 0 | public Builder() { |
101 | 0 | } |
102 | |
|
103 | 0 | public Builder(Meta metaInfo) { |
104 | 0 | if (null != metaInfo) { |
105 | 0 | this.versionInd = metaInfo.getVersionInd(); |
106 | 0 | this.createTime = metaInfo.getCreateTime(); |
107 | 0 | this.createId = metaInfo.getCreateId(); |
108 | 0 | this.updateTime = metaInfo.getUpdateTime(); |
109 | 0 | this.updateId = metaInfo.getUpdateId(); |
110 | |
} |
111 | 0 | } |
112 | |
|
113 | |
public MetaInfo build() { |
114 | 0 | return new MetaInfo(this); |
115 | |
} |
116 | |
|
117 | |
@Override |
118 | |
public String getVersionInd() { |
119 | 0 | return versionInd; |
120 | |
} |
121 | |
|
122 | |
@Override |
123 | |
public Date getCreateTime() { |
124 | 0 | return createTime; |
125 | |
} |
126 | |
|
127 | |
@Override |
128 | |
public String getCreateId() { |
129 | 0 | return createId; |
130 | |
} |
131 | |
|
132 | |
@Override |
133 | |
public Date getUpdateTime() { |
134 | 0 | return updateTime; |
135 | |
} |
136 | |
|
137 | |
@Override |
138 | |
public String getUpdateId() { |
139 | 0 | return updateId; |
140 | |
} |
141 | |
|
142 | |
public void setVersionInd(String versionInd) { |
143 | 0 | this.versionInd = versionInd; |
144 | 0 | } |
145 | |
|
146 | |
public void setCreateTime(Date createTime) { |
147 | 0 | this.createTime = createTime; |
148 | 0 | } |
149 | |
|
150 | |
public void setCreateId(String createId) { |
151 | 0 | this.createId = createId; |
152 | 0 | } |
153 | |
|
154 | |
public void setUpdateTime(Date updateTime) { |
155 | 0 | this.updateTime = updateTime; |
156 | 0 | } |
157 | |
|
158 | |
public void setUpdateId(String updateId) { |
159 | 0 | this.updateId = updateId; |
160 | 0 | } |
161 | |
} |
162 | |
} |