View Javadoc

1   /*
2    * Copyright 2009 The Kuali Foundation Licensed under the Educational Community
3    * License, Version 1.0 (the "License"); you may not use this file except in
4    * compliance with the License. You may obtain a copy of the License at
5    * http://www.opensource.org/licenses/ecl1.php Unless required by applicable law
6    * or agreed to in writing, software distributed under the License is
7    * distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
8    * KIND, either express or implied. See the License for the specific language
9    * governing permissions and limitations under the License.
10   */
11  package org.kuali.student.enrollment.lrr.dto;
12  
13  import java.io.Serializable;
14  import java.util.ArrayList;
15  import java.util.Collections;
16  import java.util.List;
17  
18  import javax.xml.bind.annotation.XmlAccessType;
19  import javax.xml.bind.annotation.XmlAccessorType;
20  import javax.xml.bind.annotation.XmlAnyElement;
21  import javax.xml.bind.annotation.XmlElement;
22  import javax.xml.bind.annotation.XmlType;
23  
24  import org.kuali.student.enrollment.lrr.infc.LearningResultRecord;
25  import org.kuali.student.r2.common.dto.IdEntityInfo;
26  import org.w3c.dom.Element;
27  
28  /**
29   * Information about the Learning Result Record Info.
30   */
31  @XmlAccessorType(XmlAccessType.FIELD)
32  @XmlType(name = "LearningResultRecordInfo", propOrder = {"id", "name", "descr", "typeKey", "stateKey", "lprId", "resultValueKey", "resultSourceIds", "meta", "attributes", "_futureElements"})
33  public class LearningResultRecordInfo extends IdEntityInfo implements LearningResultRecord, Serializable {
34  
35      private static final long serialVersionUID = 1L;
36  
37      @XmlElement
38      private String lprId;
39  
40      @XmlElement
41      private String resultValueKey;
42  
43      @XmlElement
44      private List<String> resultSourceIds;
45  
46      @XmlAnyElement
47      private List<Element> _futureElements;
48  
49      public LearningResultRecordInfo() {
50          super();
51          this.lprId = null;
52          this.resultValueKey = null;
53          this.resultSourceIds = new ArrayList<String>();
54      }
55  
56      /**
57       * This constructs a copy from LearningResultRecord infc
58       * 
59       * @param lrr
60       */
61      public LearningResultRecordInfo(LearningResultRecord lrr) {
62          super(lrr);
63  
64          this.lprId = lrr.getLprId();
65          this.resultValueKey = lrr.getResultValueKey();
66  
67          resultSourceIds = new ArrayList<String>();
68  
69          Collections.copy(resultSourceIds, lrr.getResultSourceIds());
70  
71      }
72  
73      @Override
74      public String getLprId() {
75          return lprId;
76      }
77  
78      @Override
79      public String getResultValueKey() {
80          return resultValueKey;
81      }
82  
83      @Override
84      public List<String> getResultSourceIds() {
85          if (null == resultSourceIds) {
86              resultSourceIds = new ArrayList<String>(0);
87          }
88          return resultSourceIds;
89      }
90  
91      public void setLprId(String lprId) {
92          this.lprId = lprId;
93      }
94  
95      public void setResultValueKey(String resultValueId) {
96          this.resultValueKey = resultValueId;
97      }
98  
99      public void setResultSourceIds(List<String> resultSourceIds) {
100         this.resultSourceIds = resultSourceIds;
101     }
102 }