View Javadoc

1   /*
2    * Copyright 2011 The Kuali Foundation
3    *
4    * Licensed under the Educational Community License, Version 1.0 (the
5    * "License"); you may not use this file except in compliance with the
6    * License.  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
13   * implied.  See the License for the specific language governing
14   * permissions and limitations under the License.
15   */
16  
17  package org.kuali.student.enrollment.courseoffering.dto;
18  
19  import org.kuali.student.enrollment.courseoffering.infc.AOClusterVerifyResults;
20  import org.kuali.student.r2.common.dto.ValidationResultInfo;
21  import org.kuali.student.r2.common.infc.ValidationResult;
22  import org.w3c.dom.Element;
23  
24  import javax.xml.bind.annotation.XmlAccessType;
25  import javax.xml.bind.annotation.XmlAccessorType;
26  import javax.xml.bind.annotation.XmlAnyElement;
27  import javax.xml.bind.annotation.XmlElement;
28  import javax.xml.bind.annotation.XmlType;
29  
30  import java.util.ArrayList;
31  import java.util.List;
32  import java.io.Serializable;
33  
34  /**
35   * @author Sri komandur@uw.edu
36   */
37  @XmlAccessorType(XmlAccessType.FIELD)
38  @XmlType(name = "AOClusterVerifyResultsInfo", propOrder = {
39                  "existingRGCount", "validRGCount", 
40                  "isRegenerationNeeded", "validationResults",
41                  "_futureElements"})
42  
43  public class AOClusterVerifyResultsInfo 
44      implements AOClusterVerifyResults, Serializable {
45  
46      private static final long serialVersionUID = 1L;
47  
48      @XmlElement
49      private Integer existingRGCount;
50  
51      @XmlElement
52      private Integer validRGCount;
53  
54      @XmlElement
55      private Boolean isRegenerationNeeded;
56  
57      @XmlElement
58      private List<ValidationResultInfo> validationResults;
59  
60      @XmlAnyElement
61      private List<Element> _futureElements;
62  
63      public AOClusterVerifyResultsInfo() {
64      }
65  
66      public AOClusterVerifyResultsInfo(AOClusterVerifyResults aoClusterVerifyResults) {
67  
68          this.existingRGCount = aoClusterVerifyResults.getExistingRGCount();
69          this.validRGCount = aoClusterVerifyResults.getValidRGCount();
70          this.isRegenerationNeeded = aoClusterVerifyResults.getIsRegenerationNeeded();
71  
72          if (aoClusterVerifyResults.getValidationResults() != null) {
73              this.validationResults = new ArrayList<ValidationResultInfo>();
74              for (ValidationResult validResult : aoClusterVerifyResults.getValidationResults()) {
75                  this.validationResults.add(new ValidationResultInfo(validResult));
76              }
77          }
78      }
79  
80      @Override
81      public Integer getExistingRGCount() {
82          return existingRGCount;
83      }
84  
85      public void setExistingRGCount(Integer existingRGCount) {
86          this.existingRGCount = existingRGCount;
87      }
88  
89      @Override
90      public Integer getValidRGCount() {
91          return validRGCount;
92      }
93  
94      public void setValidRGCount(Integer validRGCount) {
95          this.validRGCount = validRGCount;
96      }
97  
98      @Override
99      public Boolean getIsRegenerationNeeded() {
100         return isRegenerationNeeded;
101     }
102 
103     public void setIsRegenerationNeeded(Boolean regenerationNeeded) {
104         isRegenerationNeeded = regenerationNeeded;
105     }
106 
107     @Override
108     public List<ValidationResultInfo> getValidationResults() {
109         return validationResults;
110     }
111 
112     public void setValidationResults(List<ValidationResultInfo> validationResults) {
113         this.validationResults = validationResults;
114     }
115 }