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.ActivityOfferingSet;
20  import org.w3c.dom.Element;
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 java.util.ArrayList;
29  import java.util.List;
30  import java.io.Serializable;
31  
32  /**
33   * @author Kuali Student Team (Kamal)
34   */
35  @XmlAccessorType(XmlAccessType.FIELD)
36  @XmlType(name = "ActivityOfferingSetInfo", propOrder = {
37                  "id", "activityOfferingType", "activityOfferingIds", 
38                  "_futureElements"})
39  
40  public class ActivityOfferingSetInfo
41      implements ActivityOfferingSet, Serializable {
42  
43      private static final long serialVersionUID = 1L;
44  
45      @XmlElement
46      private String id;
47  
48      @XmlElement
49      private String activityOfferingType;
50  
51      @XmlElement
52      private List<String> activityOfferingIds;
53  
54      @XmlAnyElement
55      private List<Element> _futureElements;
56  
57      
58      /**
59       * Constructs a new ActivityOfferingSetInfo.
60       */
61      public ActivityOfferingSetInfo() {
62      }
63  
64  
65      /**
66       * Constructs a new ActivityOfferingSetInfo from another
67       * ActivityOfferingSet.
68       *
69       * @param activityOfferingSet the registration group activityOfferingSet to copy
70       */
71      public ActivityOfferingSetInfo(ActivityOfferingSet activityOfferingSet) {
72          this.id = activityOfferingSet.getId();
73  
74          if (activityOfferingSet == null) {
75              return;      
76          }
77  
78          this.activityOfferingType = activityOfferingSet.getActivityOfferingType();
79  
80          if (activityOfferingSet.getActivityOfferingIds() != null) {
81              this.activityOfferingIds = new ArrayList<String>(activityOfferingSet.getActivityOfferingIds());
82          }
83      }
84  
85      @Override
86      public String getId() {
87          return id;
88      }
89  
90      public void setId(String id) {
91          this.id = id;
92      }
93  
94      @Override
95      public String getActivityOfferingType() {
96          return this.activityOfferingType;
97      }
98  
99      public void setActivityOfferingType(String activityOfferingType) {
100         this.activityOfferingType = activityOfferingType;
101     }
102 
103     @Override
104     public List<String> getActivityOfferingIds() {
105         if (activityOfferingIds == null) {
106             activityOfferingIds = new ArrayList<String>();
107         }
108 
109         return activityOfferingIds;
110     }
111 
112     public void setActivityOfferingIds(List<String> activityOfferingIds) {
113         this.activityOfferingIds = activityOfferingIds;
114     }
115 }