1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 package org.kuali.student.contract.model.test.source;
17
18 import java.io.Serializable;
19
20 import javax.xml.bind.annotation.XmlElement;
21 import javax.xml.bind.annotation.XmlTransient;
22
23 import org.kuali.student.contract.model.test.source.HasAttributesAndMeta;
24 import org.kuali.student.contract.model.test.source.Meta;
25
26 @SuppressWarnings("serial")
27 @XmlTransient
28 public abstract class HasAttributesAndMetaInfo extends HasAttributesInfo implements HasAttributesAndMeta, Serializable {
29
30 @XmlElement
31 private final MetaInfo meta;
32
33 protected HasAttributesAndMetaInfo() {
34 meta = null;
35 }
36
37 protected HasAttributesAndMetaInfo(HasAttributesAndMeta builder) {
38 super(builder);
39 this.meta= null != builder.getMeta() ? new MetaInfo.Builder(builder.getMeta()).build() : null;
40 }
41
42 @Override
43 public MetaInfo getMeta() {
44 return meta;
45 }
46
47 public static class Builder extends HasAttributesInfo.Builder implements HasAttributesAndMeta {
48
49 private MetaInfo meta;
50
51 public Builder() {}
52
53 public Builder(HasAttributesAndMeta hasAMInfo) {
54 super(hasAMInfo);
55
56 if (null != hasAMInfo.getMeta()) {
57 MetaInfo.Builder builder = new MetaInfo.Builder();
58 builder.setCreateId(hasAMInfo.getMeta().getCreateId());
59 builder.setCreateTime(hasAMInfo.getMeta().getCreateTime());
60 builder.setUpdateId(hasAMInfo.getMeta().getUpdateId());
61 builder.setUpdateTime(hasAMInfo.getMeta().getUpdateTime());
62 builder.setVersionInd(hasAMInfo.getMeta().getVersionInd());
63 this.meta = builder.build();
64 }
65 }
66
67 @Override
68 public MetaInfo getMeta() {
69 return meta;
70 }
71
72 public void setMetaInfo(MetaInfo meta) {
73 this.meta = meta;
74 }
75 }
76 }