1 | |
|
2 | |
|
3 | |
|
4 | |
|
5 | |
|
6 | |
|
7 | |
|
8 | |
|
9 | |
|
10 | |
|
11 | |
|
12 | |
|
13 | |
package org.kuali.student.common.dto; |
14 | |
|
15 | |
import java.io.Serializable; |
16 | |
|
17 | |
import javax.xml.bind.annotation.XmlAccessType; |
18 | |
import javax.xml.bind.annotation.XmlAccessorType; |
19 | |
import javax.xml.bind.annotation.XmlAttribute; |
20 | |
import javax.xml.bind.annotation.XmlElement; |
21 | |
import javax.xml.bind.annotation.XmlTransient; |
22 | |
|
23 | |
import org.kuali.student.common.infc.KeyEntity; |
24 | |
import org.kuali.student.common.dto.EntityInfo; |
25 | |
|
26 | |
@SuppressWarnings("serial") |
27 | |
@XmlTransient |
28 | |
public abstract class KeyEntityInfo extends EntityInfo implements KeyEntity, Serializable { |
29 | |
|
30 | |
@XmlAttribute |
31 | |
private String key; |
32 | |
|
33 | 0 | protected KeyEntityInfo() { |
34 | 0 | key = null; |
35 | 0 | } |
36 | |
|
37 | |
protected KeyEntityInfo(KeyEntity builder) { |
38 | 0 | super(builder); |
39 | 0 | this.key = builder.getKey(); |
40 | 0 | } |
41 | |
|
42 | |
@Override |
43 | |
public String getKey() { |
44 | 0 | return key; |
45 | |
} |
46 | |
|
47 | |
|
48 | |
|
49 | |
|
50 | |
|
51 | |
public static class Builder extends EntityInfo.Builder implements KeyEntity { |
52 | |
|
53 | |
private String key; |
54 | |
|
55 | 0 | public Builder() {} |
56 | |
|
57 | |
public Builder(KeyEntity entity) { |
58 | 0 | super(entity); |
59 | 0 | this.key = entity.getKey(); |
60 | 0 | } |
61 | |
|
62 | |
@Override |
63 | |
public String getKey() { |
64 | 0 | return key; |
65 | |
} |
66 | |
|
67 | |
public void setKey(String key) { |
68 | 0 | this.key = key; |
69 | 0 | } |
70 | |
} |
71 | |
} |