View Javadoc
1   /**
2    * Copyright 2013 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   * Created by Mezba Mahtab (mezba.mahtab@utoronto.ca) on 2/8/13
16   */
17  package org.kuali.student.enrollment.examoffering.dto;
18  
19  import org.kuali.student.enrollment.examoffering.infc.ExamOfferingRelation;
20  import org.kuali.student.r2.common.dto.RelationshipInfo;
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  import java.io.Serializable;
28  import java.util.ArrayList;
29  import java.util.List;
30  
31  /**
32   * This class represents a relationship between a format offering and an
33   * exam offering record.
34   *
35   * @author Mezba Mahtab (mezba.mahtab@utoronto.ca)
36   */
37  @XmlAccessorType(XmlAccessType.FIELD)
38  @XmlType(name = "ExamOfferingRelationInfo", propOrder = {"id", "typeKey", "stateKey",
39          "effectiveDate", "expirationDate", "meta", "attributes",
40          "formatOfferingId", "examOfferingId", "activityOfferingIds", "populationIds",
41          "_futureElements"})
42  public class ExamOfferingRelationInfo extends RelationshipInfo implements ExamOfferingRelation, Serializable {
43  
44      ///////////////////////////
45      // CONSTANTS
46      ///////////////////////////
47  
48      private static final long serialVersionUID = 1L;
49  
50      ////////////////////////
51      // DATA VARIABLES
52      ////////////////////////
53  
54      @XmlElement
55      private String formatOfferingId;
56  
57      @XmlElement
58      private String examOfferingId;
59  
60      @XmlElement
61      private List<String> activityOfferingIds;
62  
63      @XmlElement
64      private List<String> populationIds;
65  
66      @XmlAnyElement
67      private List<Object> _futureElements;
68  
69      /////////////////////////
70      // CONSTRUCTOR
71      /////////////////////////
72  
73      public ExamOfferingRelationInfo() {}
74  
75      public ExamOfferingRelationInfo(ExamOfferingRelation examOfferingRelation) {
76          super(examOfferingRelation);
77          if (null != examOfferingRelation) {
78              this.formatOfferingId = examOfferingRelation.getFormatOfferingId();
79              this.examOfferingId = examOfferingRelation.getExamOfferingId();
80              if (examOfferingRelation.getActivityOfferingIds() != null) {
81                  this.activityOfferingIds = new ArrayList<String>(examOfferingRelation.getActivityOfferingIds());
82              }
83              if (examOfferingRelation.getPopulationIds() != null) {
84                  this.populationIds = new ArrayList<String>(examOfferingRelation.getPopulationIds());
85              }
86          }
87      }
88  
89      ////////////////////////////////
90      // GETTERS AND SETTERS
91      ////////////////////////////////
92  
93      @Override
94      public String getFormatOfferingId() {
95          return formatOfferingId;
96      }
97  
98      public void setFormatOfferingId(String formatOfferingId) {
99          this.formatOfferingId = formatOfferingId;
100     }
101 
102     @Override
103     public String getExamOfferingId() {
104         return examOfferingId;
105     }
106 
107     public void setExamOfferingId(String examOfferingId) {
108         this.examOfferingId = examOfferingId;
109     }
110 
111     @Override
112     public List<String> getActivityOfferingIds() {
113         return activityOfferingIds;
114     }
115 
116     public void setActivityOfferingIds(List<String> activityOfferingIds) {
117         this.activityOfferingIds = activityOfferingIds;
118     }
119 
120     @Override
121     public List<String> getPopulationIds() {
122         return populationIds;
123     }
124 
125     public void setPopulationIds(List<String> populationIds) {
126         this.populationIds = populationIds;
127     }
128 
129     public List<Object> get_futureElements() {
130         return _futureElements;
131     }
132 
133     public void set_futureElements(List<Object> _futureElements) {
134         this._futureElements = _futureElements;
135     }
136 }