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 @XmlType(name = "FormatInfo", propOrder = {"id", "typeKey", "stateKey", "activities", "termsOffered", "duration", "meta", "attributes" })
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 public FormatInfo() {
43
44 }
45
46 public FormatInfo(Format format) {
47 super(format);
48 if (format != null) {
49 List<ActivityInfo> activities = new ArrayList<ActivityInfo>();
50 for (Activity activity : format.getActivities()) {
51 activities.add(new ActivityInfo(activity));
52 }
53
54 this.activities = activities;
55
56 this.termsOffered = new ArrayList<String>(format.getTermsOffered());
57
58 this.duration = new TimeAmountInfo(format.getDuration());
59 }
60 }
61
62 @Override
63 public List<ActivityInfo> getActivities() {
64 if (activities == null) {
65 activities = new ArrayList<ActivityInfo>(0);
66 }
67 return activities;
68 }
69
70 public void setActivities(List<ActivityInfo> activities) {
71 this.activities = activities;
72 }
73
74 @Override
75 public List<String> getTermsOffered() {
76 return termsOffered;
77 }
78
79 public void setTermsOffered(List<String> termsOffered) {
80 this.termsOffered = termsOffered;
81 }
82
83 @Override
84 public TimeAmountInfo getDuration() {
85 return duration;
86 }
87
88 public void setDuration(TimeAmountInfo duration) {
89 this.duration = duration;
90 }
91
92 }