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.XmlElement; |
20 | |
import javax.xml.bind.annotation.XmlType; |
21 | |
|
22 | |
import org.kuali.student.r2.common.dto.IdNamelessEntityInfo; |
23 | |
import org.kuali.student.r2.common.dto.TimeAmountInfo; |
24 | |
import org.kuali.student.r2.lum.course.infc.Activity; |
25 | |
import org.kuali.student.r2.lum.course.infc.Format; |
26 | |
|
27 | 0 | @XmlType(name = "FormatInfo", propOrder = {"id", "typeKey", "stateKey", "activities", "termsOffered", "duration", "meta", "attributes", "_futureElements"}) |
28 | |
@XmlAccessorType(XmlAccessType.FIELD) |
29 | |
public class FormatInfo extends IdNamelessEntityInfo implements Format, Serializable { |
30 | |
|
31 | |
private static final long serialVersionUID = 1L; |
32 | |
|
33 | |
@XmlElement |
34 | |
private List<ActivityInfo> activities; |
35 | |
|
36 | |
@XmlElement |
37 | |
private List<String> termsOffered; |
38 | |
|
39 | |
@XmlElement |
40 | |
private TimeAmountInfo duration; |
41 | |
|
42 | 0 | public FormatInfo() { |
43 | |
|
44 | 0 | } |
45 | |
|
46 | |
public FormatInfo(Format format) { |
47 | 0 | super(format); |
48 | 0 | if (format != null) { |
49 | 0 | List<ActivityInfo> activities = new ArrayList<ActivityInfo>(); |
50 | 0 | for (Activity activity : format.getActivities()) { |
51 | 0 | activities.add(new ActivityInfo(activity)); |
52 | |
} |
53 | |
|
54 | 0 | this.activities = activities; |
55 | |
|
56 | 0 | this.termsOffered = new ArrayList<String>(format.getTermsOffered()); |
57 | |
|
58 | 0 | this.duration = new TimeAmountInfo(format.getDuration()); |
59 | |
} |
60 | 0 | } |
61 | |
|
62 | |
@Override |
63 | |
public List<ActivityInfo> getActivities() { |
64 | 0 | if (activities == null) { |
65 | 0 | activities = new ArrayList<ActivityInfo>(0); |
66 | |
} |
67 | 0 | return activities; |
68 | |
} |
69 | |
|
70 | |
public void setActivities(List<ActivityInfo> activities) { |
71 | 0 | this.activities = activities; |
72 | 0 | } |
73 | |
|
74 | |
@Override |
75 | |
public List<String> getTermsOffered() { |
76 | 0 | return termsOffered; |
77 | |
} |
78 | |
|
79 | |
public void setTermsOffered(List<String> termsOffered) { |
80 | 0 | this.termsOffered = termsOffered; |
81 | 0 | } |
82 | |
|
83 | |
@Override |
84 | |
public TimeAmountInfo getDuration() { |
85 | 0 | return duration; |
86 | |
} |
87 | |
|
88 | |
public void setDuration(TimeAmountInfo duration) { |
89 | 0 | this.duration = duration; |
90 | 0 | } |
91 | |
|
92 | |
} |