1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 package org.kuali.student.lum.lu.ui.krms.dto;
17
18 import org.kuali.student.r2.lum.clu.dto.CluSetInfo;
19
20 import java.io.Serializable;
21 import java.util.ArrayList;
22 import java.util.HashMap;
23 import java.util.List;
24 import java.util.Map;
25
26
27
28
29 public class ProgramCluSetInformation implements Serializable {
30
31 private static final long serialVersionUID = 1123124L;
32 private CluSetInfo cluSetInfo;
33 private List<CluInformation> clus;
34 private List<CluSetInfo> cluSets;
35 private Map<String, ProgramCluSetInformation> subCluSetInformations;
36 private ProgramCluSetInformation parent;
37
38 private List<CluSetRangeInformation> cluSetRange;
39
40 public CluSetInfo getCluSetInfo() {
41 return cluSetInfo;
42 }
43
44 public void setCluSetInfo(CluSetInfo cluSetInfo) {
45 this.cluSetInfo = cluSetInfo;
46 }
47
48 public List<CluInformation> getClus() {
49 if (clus == null) {
50 this.clus = new ArrayList<CluInformation>();
51 }
52 return this.clus;
53 }
54
55 public void setClus(List<CluInformation> clus) {
56 this.clus = clus;
57 }
58
59 public List<CluSetInfo> getCluSets() {
60 if (this.cluSets == null) {
61 this.cluSets = new ArrayList<CluSetInfo>();
62 }
63 return this.cluSets;
64 }
65
66 public void setCluSets(List<CluSetInfo> cluSets) {
67 this.cluSets = cluSets;
68 }
69
70
71 public List<CluSetRangeInformation> getCluSetRange() {
72 if (this.cluSetRange == null) {
73 this.cluSetRange = new ArrayList<CluSetRangeInformation>();
74 }
75 return cluSetRange;
76 }
77
78 public void setCluSetRange(List<CluSetRangeInformation> cluSetRange) {
79 this.cluSetRange.set(0, cluSetRange.get(cluSetRange.size() - 1));
80 }
81
82 public Map<String, ProgramCluSetInformation> getSubCluSetInformations() {
83 if (subCluSetInformations == null) {
84 subCluSetInformations = new HashMap<String, ProgramCluSetInformation>();
85 }
86 return subCluSetInformations;
87 }
88
89 public void setSubCluSetInformations(Map<String, ProgramCluSetInformation> subCluSetInformations) {
90 this.subCluSetInformations = subCluSetInformations;
91 }
92
93 public ProgramCluSetInformation getParent() {
94 return parent;
95 }
96
97 public void setParent(ProgramCluSetInformation parent) {
98 this.parent = parent;
99 }
100
101 public int getProgCluListSize(){
102 if (this.getClus() != null) {
103 return this.getClus().size();
104 } else {
105 return 0;
106 }
107 }
108
109 public int getProgCluSetListSize(){
110 if (this.getCluSets() != null) {
111 return this.getCluSets().size();
112 } else {
113 return 0;
114 }
115 }
116
117 public String getCluDelimitedString() {
118
119 StringBuilder sb = new StringBuilder();
120 for (CluInformation clu : this.getClus()) {
121 if (sb.length() > 0) {
122 sb.append(",");
123 }
124 sb.append(clu.getVerIndependentId());
125 }
126
127 return sb.toString();
128 }
129
130 public String getCluSetDelimitedString() {
131
132 StringBuilder sb = new StringBuilder();
133 for (CluSetInfo cluSet : this.getCluSets()) {
134 if (sb.length() > 0) {
135 sb.append(",");
136 }
137 sb.append(cluSet.getId());
138 }
139
140 return sb.toString();
141 }
142
143 public boolean hasClus() {
144 if ((this.getClus() != null) && (!this.getClus().isEmpty())) {
145 return true;
146 }
147 return false;
148 }
149
150
151 public List<String> getCluIds(){
152 List<String> cluIds = new ArrayList<String>();
153 for(CluInformation clu : this.getClus()){
154 cluIds.add(clu.getVerIndependentId());
155 }
156 return cluIds;
157 }
158
159 }