1 | |
|
2 | |
|
3 | |
|
4 | |
|
5 | |
|
6 | |
|
7 | |
|
8 | |
|
9 | |
|
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.CurrencyAmountInfo; |
24 | |
import org.kuali.student.r2.common.dto.IdEntityInfo; |
25 | |
import org.kuali.student.r2.common.infc.CurrencyAmount; |
26 | |
import org.kuali.student.r2.lum.course.infc.CourseFee; |
27 | |
import org.w3c.dom.Element; |
28 | |
|
29 | |
@XmlType(name = "CourseFeeInfo", propOrder = {"id", |
30 | |
"typeKey", "stateKey", |
31 | |
"name", "descr", |
32 | |
"feeType", "rateType", "feeAmounts", "meta", "attributes", "_futureElements"}) |
33 | |
@XmlAccessorType(XmlAccessType.FIELD) |
34 | |
public class CourseFeeInfo extends IdEntityInfo implements CourseFee, Serializable { |
35 | |
|
36 | |
private static final long serialVersionUID = 1L; |
37 | |
|
38 | |
@XmlElement |
39 | |
private String feeType; |
40 | |
|
41 | |
@XmlElement |
42 | |
private String rateType; |
43 | |
|
44 | |
@XmlElement |
45 | |
private List<CurrencyAmountInfo> feeAmounts; |
46 | |
|
47 | |
@XmlAnyElement |
48 | |
private List<Element> _futureElements; |
49 | |
|
50 | 0 | public CourseFeeInfo() { |
51 | |
|
52 | 0 | } |
53 | |
|
54 | |
public CourseFeeInfo(CourseFee courseFee) { |
55 | 0 | super(courseFee); |
56 | 0 | if (courseFee != null) { |
57 | 0 | this.feeType = courseFee.getFeeType(); |
58 | 0 | this.rateType = courseFee.getRateType(); |
59 | 0 | List<CurrencyAmountInfo> feeAmounts = new ArrayList<CurrencyAmountInfo>(); |
60 | 0 | for (CurrencyAmount courseAmount : courseFee.getFeeAmounts()) { |
61 | 0 | feeAmounts.add(new CurrencyAmountInfo(courseAmount)); |
62 | |
} |
63 | 0 | this.feeAmounts = feeAmounts; |
64 | |
} |
65 | 0 | } |
66 | |
|
67 | |
@Override |
68 | |
public String getFeeType() { |
69 | 0 | return feeType; |
70 | |
} |
71 | |
|
72 | |
public void setFeeType(String feeType) { |
73 | 0 | this.feeType = feeType; |
74 | 0 | } |
75 | |
|
76 | |
@Override |
77 | |
public String getRateType() { |
78 | 0 | return rateType; |
79 | |
} |
80 | |
|
81 | |
public void setRateType(String rateType) { |
82 | 0 | this.rateType = rateType; |
83 | 0 | } |
84 | |
|
85 | |
@Override |
86 | |
public List<CurrencyAmountInfo> getFeeAmounts() { |
87 | 0 | if (feeAmounts == null) { |
88 | 0 | feeAmounts = new ArrayList<CurrencyAmountInfo>(0); |
89 | |
} |
90 | 0 | return feeAmounts; |
91 | |
} |
92 | |
|
93 | |
public void setFeeAmounts(List<CurrencyAmountInfo> feeAmounts) { |
94 | 0 | this.feeAmounts = feeAmounts; |
95 | 0 | } |
96 | |
|
97 | |
} |