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