1 /**
2 * Copyright 2010 The Kuali Foundation Licensed under the
3 * Educational Community License, Version 2.0 (the "License"); you may
4 * not use this file except in compliance with the License. You may
5 * obtain a copy of the License at
6 *
7 * http://www.osedu.org/licenses/ECL-2.0
8 *
9 * Unless required by applicable law or agreed to in writing,
10 * software distributed under the License is distributed on an "AS IS"
11 * BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
12 * or implied. See the License for the specific language governing
13 * permissions and limitations under the License.
14 */
15
16 package org.kuali.student.core.statement.dto;
17
18 import java.io.Serializable;
19 import java.util.Date;
20 import java.util.HashMap;
21 import java.util.Map;
22
23 import javax.xml.bind.annotation.XmlAccessType;
24 import javax.xml.bind.annotation.XmlAccessorType;
25 import javax.xml.bind.annotation.XmlAttribute;
26 import javax.xml.bind.annotation.XmlElement;
27 import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
28
29 import org.kuali.student.common.dto.HasAttributes;
30 import org.kuali.student.common.dto.HasTypeState;
31 import org.kuali.student.common.dto.Idable;
32 import org.kuali.student.common.dto.MetaInfo;
33 import org.kuali.student.core.ws.binding.JaxbAttributeMapListAdapter;
34
35 @XmlAccessorType(XmlAccessType.FIELD)
36 public class RefStatementRelationInfo implements Serializable, Idable, HasTypeState, HasAttributes {
37
38 private static final long serialVersionUID = 1L;
39
40 @XmlElement
41 private String refObjectTypeKey;
42
43 @XmlElement
44 private String refObjectId;
45
46 @XmlElement
47 private String statementId;
48
49 @XmlElement
50 private Date effectiveDate;
51
52 @XmlElement
53 private Date expirationDate;
54
55 @XmlElement
56 @XmlJavaTypeAdapter(JaxbAttributeMapListAdapter.class)
57 private Map<String, String> attributes = new HashMap<String, String>();
58
59 @XmlElement
60 private MetaInfo metaInfo;
61
62 @XmlAttribute
63 private String type;
64
65 @XmlAttribute
66 private String state;
67
68 @XmlAttribute
69 private String id;
70
71 /**
72 * Gets the unique identifier for an object type.
73 * Used to identify the type of object being referred to,
74 * so that the id can be resolved.
75 *
76 * @return Reference object type key
77 */
78 public String getRefObjectTypeKey() {
79 return refObjectTypeKey;
80 }
81
82 /**
83 * Sets the unique identifier for an object type.
84 * Used to identify the type of object being referred to,
85 * so that the id can be resolved.
86 *
87 * @param refObjectTypeKey Reference object type key
88 */
89 public void setRefObjectTypeKey(String refObjectTypeKey) {
90 this.refObjectTypeKey = refObjectTypeKey;
91 }
92
93 /**
94 * Sets the identifier for an object.
95 * This will likely require some additional context in order to be resolved,
96 * such as the type of object. An objectId could be a cluId, a luiId,
97 * an orgId, a documentId, etc.
98 *
99 * @return Reference object id
100 */
101 public String getRefObjectId() {
102 return refObjectId;
103 }
104
105 /**
106 * Gets the identifier for an object.
107 * This will likely require some additional context in order to be resolved,
108 * such as the type of object. An objectId could be a cluId, a luiId,
109 * an orgId, a documentId, etc.
110 *
111 * @param refObjectId Reference object id
112 */
113 public void setRefObjectId(String refObjectId) {
114 this.refObjectId = refObjectId;
115 }
116
117 /**
118 * Gets the unique identifier for a single statement record.
119 *
120 * @return
121 */
122 public String getStatementId() {
123 return statementId;
124 }
125
126 /**
127 * Sets the unique identifier for a single statement record.
128 *
129 * @param statementId Statement id
130 */
131 public void setStatementId(String statementId) {
132 this.statementId = statementId;
133 }
134
135 /**
136 * Gets the date and time that this object to statement relationship
137 * became effective. This is a similar concept to the effective date on
138 * enumerated values. When an expiration date has been specified,
139 * this field must be less than or equal to the expiration date.
140 *
141 * @return Object to statement relationship effective date
142 */
143 public Date getEffectiveDate() {
144 return effectiveDate;
145 }
146
147 /**
148 * Sets the date and time that this object to statement relationship
149 * became effective. This is a similar concept to the effective date on
150 * enumerated values. When an expiration date has been specified,
151 * this field must be less than or equal to the expiration date.
152 *
153 * @param effectiveDate Object to statement relationship effective date
154 */
155 public void setEffectiveDate(Date effectiveDate) {
156 this.effectiveDate = effectiveDate;
157 }
158
159 /**
160 * Gets the date and time that this object to statement relationship expires.
161 * This is a similar concept to the expiration date on enumerated values.
162 * If specified, this should be greater than or equal to the effective date.
163 * If this field is not specified, then no expiration date has been
164 * currently defined and should automatically be considered greater
165 * than the effective date.
166 *
167 * @return Object to statement relationship expiration date
168 */
169 public Date getExpirationDate() {
170 return expirationDate;
171 }
172
173 /**
174 * Sets the date and time that this object to statement relationship expires.
175 * This is a similar concept to the expiration date on enumerated values.
176 * If specified, this should be greater than or equal to the effective date.
177 * If this field is not specified, then no expiration date has been
178 * currently defined and should automatically be considered greater
179 * than the effective date.
180 *
181 * @param expirationDate Object to statement relationship expiration date
182 */
183 public void setExpirationDate(Date expirationDate) {
184 this.expirationDate = expirationDate;
185 }
186
187 /**
188 * Gets the list of key/value pairs, typically used for dynamic attributes.
189 *
190 * @return Map of attributes
191 */
192 public Map<String, String> getAttributes() {
193 return attributes;
194 }
195
196 /**
197 * Sets the list of key/value pairs, typically used for dynamic attributes.
198 *
199 * @param attributes Map of attributes
200 */
201 public void setAttributes(Map<String, String> attributes) {
202 this.attributes = attributes;
203 }
204
205 /**
206 * Gets the create and last update info for the structure.
207 * This is optional and treated as read only since the data is set by
208 * the internals of the service during maintenance operations.
209 *
210 * @return Meta data information
211 */
212 public MetaInfo getMetaInfo() {
213 return metaInfo;
214 }
215
216 /**
217 * Sets the create and last update info for the structure.
218 * This is optional and treated as read only since the data is set by
219 * the internals of the service during maintenance operations.
220 *
221 * @param metaInfo Meta data information
222 */
223 public void setMetaInfo(MetaInfo metaInfo) {
224 this.metaInfo = metaInfo;
225 }
226
227 /**
228 * Gets the object to statement relation type.
229 *
230 * @return Object to statement relation type
231 */
232 public String getType() {
233 return type;
234 }
235
236 /**
237 * Sets the object to statement relation type.
238 *
239 * @param type Object to statement relation type
240 */
241 public void setType(String type) {
242 this.type = type;
243 }
244
245 /**
246 * Gets the identifier for the current status of the object to statement
247 * relationship. The values for this field are constrained to those in
248 * the refStatementRelationState enumeration. A separate setup operation
249 * does not exist for retrieval of the meta data around this value.
250 *
251 * @return Object to statement relation state
252 */
253 public String getState() {
254 return state;
255 }
256
257 /**
258 * Sets the identifier for the current status of the object to statement
259 * relationship. The values for this field are constrained to those in
260 * the refStatementRelationState enumeration. A separate setup operation
261 * does not exist for retrieval of the meta data around this value.
262 *
263 * @param state Object to statement relation state
264 */
265 public void setState(String state) {
266 this.state = state;
267 }
268
269 /**
270 * Gets the unique identifier for a single Object Statement Relationship record.
271 *
272 * @return Object to Statement Relation Identifier
273 */
274 public String getId() {
275 return id;
276 }
277
278 /**
279 * Sets the unique identifier for a single Object Statement Relationship record.
280 *
281 * @param id Object to statement relation identifier
282 */
283 public void setId(String id) {
284 this.id = id;
285 }
286
287 @Override
288 public String toString() {
289 return "RefStatementRelationInfo[id=" + id + ", type=" + type
290 + ", statementId=" + statementId + ", refObjectId="
291 + refObjectId + ", refObjectTypeKey=" + refObjectTypeKey + "]";
292 }
293 }