1 | |
|
2 | |
|
3 | |
|
4 | |
|
5 | |
|
6 | |
|
7 | |
|
8 | |
package org.kuali.student.common.dto; |
9 | |
|
10 | |
import java.io.Serializable; |
11 | |
import java.util.List; |
12 | |
|
13 | |
import javax.xml.bind.annotation.XmlAccessType; |
14 | |
import javax.xml.bind.annotation.XmlAccessorType; |
15 | |
import javax.xml.bind.annotation.XmlAnyElement; |
16 | |
import javax.xml.bind.annotation.XmlElement; |
17 | |
import javax.xml.bind.annotation.XmlType; |
18 | |
|
19 | |
import org.kuali.student.common.infc.Attribute; |
20 | |
import org.kuali.student.common.infc.ModelBuilder; |
21 | |
import org.w3c.dom.Element; |
22 | |
|
23 | |
@XmlAccessorType(XmlAccessType.FIELD) |
24 | |
@XmlType(name = "AttributeInfo", propOrder = {"id", "key", "value", "_futureElements"}) |
25 | 0 | public final class AttributeInfo implements Attribute, Serializable { |
26 | |
|
27 | |
private static final long serialVersionUID = 1L; |
28 | |
|
29 | |
@XmlElement |
30 | |
private final String id; |
31 | |
|
32 | |
@XmlElement |
33 | |
private final String key; |
34 | |
|
35 | |
@XmlElement |
36 | |
private final String value; |
37 | |
|
38 | |
@XmlAnyElement |
39 | |
private final List<Element> _futureElements; |
40 | |
|
41 | 0 | private AttributeInfo() { |
42 | 0 | this.id = null; |
43 | 0 | this.key = null; |
44 | 0 | this.value = null; |
45 | 0 | this._futureElements = null; |
46 | 0 | } |
47 | |
|
48 | 0 | private AttributeInfo(Attribute builder) { |
49 | 0 | this.id = builder.getId(); |
50 | 0 | this.key = builder.getKey(); |
51 | 0 | this.value = builder.getValue(); |
52 | 0 | this._futureElements = null; |
53 | 0 | } |
54 | |
|
55 | |
@Override |
56 | |
public String getId() { |
57 | 0 | return id; |
58 | |
} |
59 | |
|
60 | |
|
61 | |
@Override |
62 | |
public String getKey() { |
63 | 0 | return key; |
64 | |
} |
65 | |
|
66 | |
|
67 | |
@Override |
68 | |
public String getValue() { |
69 | 0 | return value; |
70 | |
} |
71 | |
|
72 | |
|
73 | 0 | public static class Builder implements ModelBuilder<AttributeInfo>, Attribute { |
74 | |
|
75 | |
private String id; |
76 | |
private String value; |
77 | |
private String key; |
78 | |
|
79 | 0 | public Builder() { |
80 | 0 | } |
81 | |
|
82 | 0 | public Builder(Attribute attInfo) { |
83 | 0 | this.id = attInfo.getId(); |
84 | 0 | this.key = attInfo.getKey(); |
85 | 0 | this.value = attInfo.getValue(); |
86 | 0 | } |
87 | |
|
88 | |
public AttributeInfo build() { |
89 | 0 | return new AttributeInfo(this); |
90 | |
} |
91 | |
|
92 | |
@Override |
93 | |
public String getId() { |
94 | 0 | return id; |
95 | |
} |
96 | |
|
97 | |
@Override |
98 | |
public String getKey() { |
99 | 0 | return key; |
100 | |
} |
101 | |
|
102 | |
@Override |
103 | |
public String getValue() { |
104 | 0 | return value; |
105 | |
} |
106 | |
|
107 | |
public void setId(String id) { |
108 | 0 | this.id = id; |
109 | 0 | } |
110 | |
|
111 | |
public void setKey(String key) { |
112 | 0 | this.key = key; |
113 | 0 | } |
114 | |
|
115 | |
public void setValue(String val) { |
116 | 0 | this.value = val; |
117 | 0 | } |
118 | |
} |
119 | |
} |