View Javadoc

1   /*
2    * Copyright 2007 The Kuali Foundation
3    *
4    * Licensed under the Educational Community License, Version 1.0 (the "License");
5    * you may not use this file except in compliance with the License.
6    * You may obtain a copy of the License at
7    *
8    * http://www.opensource.org/licenses/ecl1.php
9    *
10   * Unless required by applicable law or agreed to in writing, software
11   * distributed under the License is distributed on an "AS IS" BASIS,
12   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13   * See the License for the specific language governing permissions and
14   * limitations under the License.
15   */
16  package org.kuali.student.r2.lum.lrc.dto;
17  
18  import java.util.ArrayList;
19  import java.util.Date;
20  import java.util.List;
21  
22  import javax.xml.bind.annotation.XmlAccessType;
23  import javax.xml.bind.annotation.XmlAccessorType;
24  import javax.xml.bind.annotation.XmlAnyElement;
25  import javax.xml.bind.annotation.XmlElement;
26  import javax.xml.bind.annotation.XmlType;
27  
28  import org.kuali.student.r2.common.dto.KeyEntityInfo;
29  import org.kuali.student.r2.lum.lrc.infc.ResultValuesGroup;
30  
31  /**
32   * Detailed information about a group of result values.
33   * 
34   * This grouping can be expressed two ways:
35   * (1) as an explicit list of values, i.e. A, B, C, etc
36   * (2) as a range of numeric values 1-100 with .01 increments
37   * 
38   * It may also combine the two approaches.  (3) A numeric range for a
39   * grade 1-100 but also allow for grades like I for incomplete.
40   * 
41   * Note: This object has been renamed from R1, previously it was
42   * called ResultComponent.
43   * 
44   * @Author sambit
45   * @Since Tue Apr 21 13:47:47 PDT 2009
46   */
47  @XmlAccessorType(XmlAccessType.FIELD)
48  @XmlType(name = "GradeValuesGroupInfo", propOrder = { 
49          "key", "typeKey", "stateKey", "name", "descr", "resultScaleKey", 
50          "resultValueKeys", "resultValueRange", "effectiveDate",
51          "expirationDate", "meta", "attributes" , "_futureElements" }) 
52  
53  public class ResultValuesGroupInfo 
54          extends KeyEntityInfo 
55          implements ResultValuesGroup {
56  
57      private static final long serialVersionUID = 1L;
58      @XmlElement
59      private String resultScaleKey;
60      @XmlElement
61      private List<String> resultValueKeys;
62      @XmlElement
63      private ResultValueRangeInfo resultValueRange;
64      @XmlElement
65      private Date effectiveDate;
66      @XmlElement
67      private Date expirationDate;
68      @XmlAnyElement
69      private List<Object> _futureElements;  
70  
71      public ResultValuesGroupInfo() {
72          resultScaleKey = null;
73          resultValueKeys = new ArrayList<String>();
74          resultValueRange = null;
75          effectiveDate = null;
76          expirationDate = null;
77      }
78  
79      public ResultValuesGroupInfo(ResultValuesGroup orig) {
80          super(orig);
81          if (null != orig) {
82              this.resultScaleKey = orig.getResultScaleKey();
83              this.resultValueKeys = new ArrayList<String>(orig.getResultValueKeys());
84              if (orig.getResultValueRange() != null) {
85              this.resultValueRange = new ResultValueRangeInfo(orig.getResultValueRange());
86              }
87              if (orig.getEffectiveDate() != null) {
88                  this.effectiveDate = new Date(orig.getEffectiveDate().getTime());
89              }
90              if (orig.getExpirationDate() != null) {
91                  this.expirationDate = new Date(orig.getExpirationDate().getTime());
92              }
93          }
94      }
95  
96      @Override
97      public String getResultScaleKey() {
98          return resultScaleKey;
99      }
100 
101     public void setResultScaleKey(String resultScaleKey) {
102         this.resultScaleKey = resultScaleKey;
103     }
104 
105     @Override
106     public List<String> getResultValueKeys() {
107         if (this.resultValueKeys == null) {
108             this.resultValueKeys = new ArrayList<String>();
109         }
110         return resultValueKeys;
111     }
112 
113     public void setResultValueKeys(List<String> resultValueKeys) {
114         this.resultValueKeys = resultValueKeys;
115     }
116 
117     @Override
118     public ResultValueRangeInfo getResultValueRange() {
119         return resultValueRange;
120     }
121 
122     public void setResultValueRange(ResultValueRangeInfo resultValueRange) {
123         this.resultValueRange = resultValueRange;
124     }
125 
126     @Override
127     public Date getEffectiveDate() {
128         return effectiveDate;
129     }
130 
131     public void setEffectiveDate(Date effectiveDate) {
132         this.effectiveDate = effectiveDate;
133     }
134 
135     @Override
136     public Date getExpirationDate() {
137         return expirationDate;
138     }
139 
140     public void setExpirationDate(Date expirationDate) {
141         this.expirationDate = expirationDate;
142     }
143 }