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.r2.lum.course.dto;
12  
13  import java.io.Serializable;
14  import java.util.ArrayList;
15  import java.util.List;
16  
17  import javax.xml.bind.annotation.XmlAccessType;
18  import javax.xml.bind.annotation.XmlAccessorType;
19  import javax.xml.bind.annotation.XmlAnyElement;
20  import javax.xml.bind.annotation.XmlElement;
21  import javax.xml.bind.annotation.XmlType;
22  
23  import org.kuali.student.r2.common.dto.IdNamelessEntityInfo;
24  import org.kuali.student.r2.lum.course.infc.CourseRevenue;
25  import org.kuali.student.r2.lum.clu.dto.AffiliatedOrgInfo;
26  import org.kuali.student.r2.lum.clu.infc.AffiliatedOrg;
27  
28  /**
29   * Detailed information about revenue collected from the course.
30   * 
31   * @Author KSContractMojo
32   * @Author Daniel Epstein
33   * @Since Mon Jul 26 14:12:38 EDT 2010
34   * @See <a href=
35   *      "https://test.kuali.org/confluence/display/KULSTU/courseRevenueInfo+Structure"
36   *      >CourseReenueInfo</>
37   */
38  
39  @XmlType(name = "CourseRevenueInfo", propOrder = {"id", "typeKey", "stateKey", "affiliatedOrgs", "feeType", "meta", "attributes" , "_futureElements" }) 
40  @XmlAccessorType(XmlAccessType.FIELD)
41  public class CourseRevenueInfo extends IdNamelessEntityInfo implements CourseRevenue, Serializable {
42  
43      private static final long serialVersionUID = 1L;
44  
45      @XmlElement
46      private String feeType;
47  
48      @XmlElement
49      private List<AffiliatedOrgInfo> affiliatedOrgs;
50  
51      @XmlAnyElement
52      private List<Object> _futureElements;  
53  
54      public CourseRevenueInfo() {
55  
56      }
57  
58      public CourseRevenueInfo(CourseRevenue courseRevenue) {
59          super(courseRevenue);
60          if (courseRevenue != null) {
61              this.feeType = courseRevenue.getFeeType();
62              List<AffiliatedOrgInfo> affilatedOrgs = new ArrayList<AffiliatedOrgInfo>();
63  
64              for (AffiliatedOrg affiliatedOrg : courseRevenue.getAffiliatedOrgs()) {
65                  affilatedOrgs.add(new AffiliatedOrgInfo(affiliatedOrg));
66  
67              }
68              this.affiliatedOrgs = affilatedOrgs;
69          }
70      }
71  
72      /**
73       * A code that identifies the type of the fee with which this revenue is
74       * associated with.
75       */
76      @Override
77      public String getFeeType() {
78          return feeType;
79      }
80  
81      public void setFeeType(String feeType) {
82          this.feeType = feeType;
83      }
84  
85      /**
86       * List of affiliated organizations.
87       */
88      @Override
89      public List<AffiliatedOrgInfo> getAffiliatedOrgs() {
90          if (affiliatedOrgs == null) {
91              affiliatedOrgs = new ArrayList<AffiliatedOrgInfo>(0);
92          }
93          return affiliatedOrgs;
94      }
95  
96      public void setAffiliatedOrgs(List<AffiliatedOrgInfo> affiliatedOrgs) {
97          this.affiliatedOrgs = affiliatedOrgs;
98      }
99  
100 }