View Javadoc

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.r2.lum.lrc.dto;
17  
18  import java.io.Serializable;
19  import java.util.ArrayList;
20  import java.util.Date;
21  import java.util.HashMap;
22  import java.util.List;
23  import java.util.Map;
24  
25  import javax.xml.bind.annotation.XmlAccessType;
26  import javax.xml.bind.annotation.XmlAccessorType;
27  import javax.xml.bind.annotation.XmlAttribute;
28  import javax.xml.bind.annotation.XmlElement;
29  import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
30  
31  import org.kuali.student.core.ws.binding.JaxbAttributeMapListAdapter;
32  import org.kuali.student.r1.common.dto.HasTypeState;
33  import org.kuali.student.r1.common.dto.Idable;
34  import org.kuali.student.r2.common.dto.MetaInfo;
35  import org.kuali.student.r2.common.dto.RichTextInfo;
36  import org.kuali.student.r1.common.dto.HasAttributes;
37  /**
38   * Detailed information about a result component.
39   *
40   * @Author KSContractMojo
41   * @Author lindholm
42   * @Since Tue Apr 21 13:47:47 PDT 2009
43   * @See <a href="https://test.kuali.org/confluence/display/KULSTU/resultComponentInfo+Structure">ResultComponentInfo</>
44   *
45   */
46  @XmlAccessorType(XmlAccessType.FIELD)
47  public class ResultComponentInfo implements Serializable, Idable, HasTypeState, HasAttributes {
48  
49      private static final long serialVersionUID = 1L;
50  
51      @XmlElement
52      private String name;
53  
54      @XmlElement
55      private RichTextInfo desc;
56  
57      @XmlElement
58      private List<String> resultValues;
59  
60      @XmlElement
61      private Date effectiveDate;
62  
63      @XmlElement
64      private Date expirationDate;
65  
66      @XmlElement
67      @XmlJavaTypeAdapter(JaxbAttributeMapListAdapter.class)
68      private Map<String, String> attributes;
69  
70      @XmlElement
71      private MetaInfo metaInfo;
72  
73      @XmlAttribute
74      private String type;
75  
76      @XmlAttribute
77      private String state;
78  
79      @XmlAttribute
80      private String id;
81  
82      /**
83       * Friendly name of the result component
84       */
85      public String getName() {
86          return name;
87      }
88  
89      public void setName(String name) {
90          this.name = name;
91      }
92  
93      /**
94       * Narrative description of the result component
95       */
96      public RichTextInfo getDesc() {
97          return desc;
98      }
99  
100     public void setDesc(RichTextInfo desc) {
101         this.desc = desc;
102     }
103 
104     /**
105      * List of result values
106      */
107     public List<String> getResultValues() {
108         if (resultValues == null) {
109             resultValues = new ArrayList<String>(0);
110         }
111         return resultValues;
112     }
113 
114     public void setResultValues(List<String> resultValues) {
115         this.resultValues = resultValues;
116     }
117 
118     /**
119      * Date and time that this result component became effective. This is a similar concept to the effective date on enumerated values. When an expiration date has been specified, this field must be less than or equal to the expiration date.
120      */
121     public Date getEffectiveDate() {
122         return effectiveDate;
123     }
124 
125     public void setEffectiveDate(Date effectiveDate) {
126         this.effectiveDate = effectiveDate;
127     }
128 
129     /**
130      * Date and time that this result component expires. This is a similar concept to the expiration date on enumerated values. If specified, this should be greater than or equal to the effective date. If this field is not specified, then no expiration date has been currently defined and should automatically be considered greater than the effective date.
131      */
132     public Date getExpirationDate() {
133         return expirationDate;
134     }
135 
136     public void setExpirationDate(Date expirationDate) {
137         this.expirationDate = expirationDate;
138     }
139 
140     /**
141      * List of key/value pairs, typically used for dynamic attributes.
142      */
143     public Map<String, String> getAttributes() {
144         if (attributes == null) {
145             attributes = new HashMap<String, String>();
146         }
147         return attributes;
148     }
149 
150     public void setAttributes(Map<String, String> attributes) {
151         this.attributes = attributes;
152     }
153 
154     /**
155      * Create and last update info for the structure. This is optional and treated as read only since the data is set by the internals of the service during maintenance operations.
156      */
157     public MetaInfo getMetaInfo() {
158         return metaInfo;
159     }
160 
161     public void setMetaInfo(MetaInfo metaInfo) {
162         this.metaInfo = metaInfo;
163     }
164 
165     /**
166      * Unique identifier for a result component type.
167      */
168     public String getType() {
169         return type;
170     }
171 
172     public void setType(String type) {
173         this.type = type;
174     }
175 
176     /**
177      * The current status of the result component. The values for this field are constrained to those in the state enumeration. A separate setup operation does not exist for retrieval of the meta data around this value.
178      */
179     public String getState() {
180         return state;
181     }
182 
183     public void setState(String state) {
184         this.state = state;
185     }
186 
187     /**
188      * Unique identifier for a result component. This is optional, due to the identifier being set at the time of creation. Once the result component has been created, this should be seen as required.
189      */
190     public String getId() {
191         return id;
192     }
193 
194     public void setId(String id) {
195         this.id = id;
196     }
197 }