| 1 | |
|
| 2 | |
|
| 3 | |
|
| 4 | |
|
| 5 | |
|
| 6 | |
|
| 7 | |
|
| 8 | |
|
| 9 | |
|
| 10 | |
|
| 11 | |
|
| 12 | |
|
| 13 | |
|
| 14 | |
|
| 15 | |
|
| 16 | |
package org.kuali.student.lum.common.client.widgets; |
| 17 | |
|
| 18 | |
import java.util.Collections; |
| 19 | |
import java.util.Date; |
| 20 | |
import java.util.HashSet; |
| 21 | |
import java.util.Set; |
| 22 | |
|
| 23 | |
import org.kuali.student.common.assembly.data.Data; |
| 24 | |
import org.kuali.student.common.assembly.helper.PropertyEnum; |
| 25 | |
import org.kuali.student.lum.common.client.lo.MetaInfoHelper; |
| 26 | |
|
| 27 | 0 | public class CluSetHelper { |
| 28 | |
|
| 29 | 0 | private final static Set<String> properties = new HashSet<String>(); |
| 30 | |
|
| 31 | |
public static Set<String> getProperties(){ |
| 32 | 0 | return Collections.unmodifiableSet(properties); |
| 33 | |
} |
| 34 | |
|
| 35 | 0 | public enum Properties implements PropertyEnum |
| 36 | |
{ |
| 37 | 0 | ID ("id"), |
| 38 | 0 | ORGANIZATION ("organization"), |
| 39 | 0 | DESCRIPTION ("description"), |
| 40 | 0 | EFFECTIVE_DATE ("effectiveDate"), |
| 41 | 0 | EXPIRATION_DATE ("expirationDate"), |
| 42 | 0 | APPROVED_CLUS ("approvedClus"), |
| 43 | 0 | PROPOSED_CLUS ("proposedClus"), |
| 44 | |
|
| 45 | 0 | ALL_CLUS ("allClus"), |
| 46 | 0 | CLUSETS ("clusets"), |
| 47 | 0 | CLU_SET_RANGE ("clusetRange"), |
| 48 | 0 | CLU_SET_RANGE_VIEW_DETAILS ("cluSetRangeViewDetails"), |
| 49 | 0 | META_INFO ("metaInfo"), |
| 50 | 0 | NAME ("name"), |
| 51 | 0 | STATE ("state"), |
| 52 | 0 | TYPE ("type"), |
| 53 | 0 | REUSABLE ("reusable"), |
| 54 | 0 | REFERENCEABLE ("referenceable"); |
| 55 | |
|
| 56 | |
private final String key; |
| 57 | |
|
| 58 | |
|
| 59 | 0 | private Properties (final String key) { |
| 60 | 0 | this.key = key; |
| 61 | 0 | properties.add(key); |
| 62 | 0 | } |
| 63 | |
|
| 64 | |
@Override |
| 65 | |
public String getKey() { |
| 66 | 0 | return this.key; |
| 67 | |
} |
| 68 | |
|
| 69 | |
|
| 70 | |
} |
| 71 | |
private Data data; |
| 72 | |
|
| 73 | 0 | public CluSetHelper(Data data) { |
| 74 | 0 | this.data = data; |
| 75 | 0 | } |
| 76 | |
|
| 77 | |
public static CluSetHelper wrap(Data data) { |
| 78 | 0 | if (data == null) { |
| 79 | 0 | return null; |
| 80 | |
} |
| 81 | 0 | return new CluSetHelper(data); |
| 82 | |
} |
| 83 | |
|
| 84 | |
public Data getData() { |
| 85 | 0 | return this.data; |
| 86 | |
} |
| 87 | |
|
| 88 | |
public void setId(String value) { |
| 89 | 0 | data.set(Properties.ID.getKey(), value); |
| 90 | 0 | } |
| 91 | |
|
| 92 | |
public String getId() { |
| 93 | 0 | return (String) data.get(Properties.ID.getKey()); |
| 94 | |
} |
| 95 | |
|
| 96 | |
public void setOrganization(String value) { |
| 97 | 0 | data.set(Properties.ORGANIZATION.getKey(), value); |
| 98 | 0 | } |
| 99 | |
public String getOrganization() { |
| 100 | 0 | return (String) data.get(Properties.ORGANIZATION.getKey()); |
| 101 | |
} |
| 102 | |
|
| 103 | |
public void setDescription(String value) { |
| 104 | 0 | data.set(Properties.DESCRIPTION.getKey(), value); |
| 105 | 0 | } |
| 106 | |
public String getDescription() { |
| 107 | 0 | return (String) data.get (Properties.DESCRIPTION.getKey ()); |
| 108 | |
} |
| 109 | |
|
| 110 | |
public void setEffectiveDate(Date value) { |
| 111 | 0 | data.set(Properties.EFFECTIVE_DATE.getKey(), value); |
| 112 | 0 | } |
| 113 | |
public Date getEffectiveDate() { |
| 114 | 0 | return (Date) data.get(Properties.EFFECTIVE_DATE.getKey()); |
| 115 | |
} |
| 116 | |
|
| 117 | |
public void setExpirationDate(Date value) { |
| 118 | 0 | data.set(Properties.EXPIRATION_DATE.getKey(), value); |
| 119 | 0 | } |
| 120 | |
public Date getExpirationDate() { |
| 121 | 0 | return (Date) data.get(Properties.EXPIRATION_DATE.getKey()); |
| 122 | |
} |
| 123 | |
|
| 124 | |
public void setMetaInfo (MetaInfoHelper value) { |
| 125 | 0 | data.set (Properties.META_INFO.getKey (), (value == null) ? null : value.getData ()); |
| 126 | 0 | } |
| 127 | |
public MetaInfoHelper getMetaInfo () { |
| 128 | 0 | return MetaInfoHelper.wrap ((Data) data.get (Properties.META_INFO.getKey ())); |
| 129 | |
} |
| 130 | |
|
| 131 | |
public void setName(String name) { |
| 132 | 0 | data.set(Properties.NAME.getKey(), name); |
| 133 | 0 | } |
| 134 | |
public String getName() { |
| 135 | 0 | return (String) data.get(Properties.NAME.getKey()); |
| 136 | |
} |
| 137 | |
|
| 138 | |
public void setState(String state) { |
| 139 | 0 | data.set(Properties.STATE.getKey(), state); |
| 140 | 0 | } |
| 141 | |
public String getState() { |
| 142 | 0 | return (String) data.get(Properties.STATE.getKey()); |
| 143 | |
} |
| 144 | |
|
| 145 | |
public void setType(String type) { |
| 146 | 0 | data.set(Properties.TYPE.getKey(), type); |
| 147 | 0 | } |
| 148 | |
public String getType() { |
| 149 | 0 | return (String) data.get(Properties.TYPE.getKey()); |
| 150 | |
} |
| 151 | |
|
| 152 | |
public void setReusable(Boolean reusable) { |
| 153 | 0 | Boolean newValue = reusable; |
| 154 | 0 | if (reusable == null) { |
| 155 | 0 | newValue = new Boolean(false); |
| 156 | |
} |
| 157 | 0 | data.set(Properties.REUSABLE.getKey(), newValue); |
| 158 | 0 | } |
| 159 | |
public Boolean getReusable() { |
| 160 | 0 | Boolean reUsable = (Boolean) data.get(Properties.REUSABLE.getKey()); |
| 161 | 0 | if (reUsable == null) { |
| 162 | 0 | reUsable = new Boolean(false); |
| 163 | |
} |
| 164 | 0 | return reUsable; |
| 165 | |
} |
| 166 | |
|
| 167 | |
public void setReferenceable(Boolean referenceable) { |
| 168 | 0 | Boolean newValue = referenceable; |
| 169 | 0 | if (referenceable == null) { |
| 170 | 0 | newValue = new Boolean(false); |
| 171 | |
} |
| 172 | 0 | data.set(Properties.REFERENCEABLE.getKey(), newValue); |
| 173 | 0 | } |
| 174 | |
public Boolean getReferenceable() { |
| 175 | 0 | Boolean referenceable = (Boolean) data.get(Properties.REFERENCEABLE.getKey()); |
| 176 | 0 | if (referenceable == null) { |
| 177 | 0 | referenceable = new Boolean(false); |
| 178 | |
} |
| 179 | 0 | return referenceable; |
| 180 | |
} |
| 181 | |
|
| 182 | |
public void setApprovedClus(Data value) { |
| 183 | 0 | data.set(Properties.APPROVED_CLUS.getKey(), value); |
| 184 | 0 | } |
| 185 | |
public Data getApprovedClus() { |
| 186 | 0 | Data approvedClusData = data.get(Properties.APPROVED_CLUS.getKey()); |
| 187 | 0 | if (approvedClusData == null) { |
| 188 | 0 | approvedClusData = new Data(); |
| 189 | 0 | setApprovedClus(approvedClusData); |
| 190 | |
} |
| 191 | 0 | return approvedClusData; |
| 192 | |
} |
| 193 | |
public void setProposedClus(Data value) { |
| 194 | 0 | data.set(Properties.PROPOSED_CLUS.getKey(), value); |
| 195 | 0 | } |
| 196 | |
public Data getProposedClus() { |
| 197 | 0 | Data proposedClusData = data.get(Properties.PROPOSED_CLUS.getKey()); |
| 198 | 0 | if (proposedClusData == null) { |
| 199 | 0 | proposedClusData = new Data(); |
| 200 | 0 | setProposedClus(proposedClusData); |
| 201 | |
} |
| 202 | 0 | return proposedClusData; |
| 203 | |
} |
| 204 | |
public void setAllClus(Data value) { |
| 205 | 0 | data.set(Properties.ALL_CLUS.getKey(), value); |
| 206 | 0 | } |
| 207 | |
public Data getAllClus() { |
| 208 | 0 | Data allClusData = data.get(Properties.ALL_CLUS.getKey()); |
| 209 | 0 | if (allClusData == null) { |
| 210 | 0 | allClusData = new Data(); |
| 211 | 0 | setAllClus(allClusData); |
| 212 | |
} |
| 213 | 0 | return allClusData; |
| 214 | |
} |
| 215 | |
public void setCluSets(Data value) { |
| 216 | 0 | data.set(Properties.CLUSETS.getKey(), value); |
| 217 | 0 | } |
| 218 | |
public Data getCluSets() { |
| 219 | 0 | Data cluSetData = data.get(Properties.CLUSETS.getKey()); |
| 220 | 0 | if (cluSetData == null) { |
| 221 | 0 | cluSetData = new Data(); |
| 222 | 0 | setCluSets(cluSetData); |
| 223 | |
} |
| 224 | 0 | return cluSetData; |
| 225 | |
} |
| 226 | |
public void setCluRangeParams(Data value) { |
| 227 | 0 | data.set(Properties.CLU_SET_RANGE.getKey(), value); |
| 228 | 0 | } |
| 229 | |
public CluSetRangeHelper getCluRangeParams() { |
| 230 | 0 | Data cluRangeParamsData = data.get(Properties.CLU_SET_RANGE.getKey()); |
| 231 | 0 | if (cluRangeParamsData == null) { |
| 232 | 0 | cluRangeParamsData = new Data(); |
| 233 | 0 | setCluRangeParams(cluRangeParamsData); |
| 234 | |
} |
| 235 | 0 | return new CluSetRangeHelper(cluRangeParamsData); |
| 236 | |
} |
| 237 | |
public void setCluRangeViewDetails(Data value) { |
| 238 | 0 | data.set(Properties.CLU_SET_RANGE_VIEW_DETAILS.getKey(), value); |
| 239 | 0 | } |
| 240 | |
public Data getCluRangeViewDetails() { |
| 241 | 0 | Data cluSetRangeViewDetailsData = data.get(Properties.CLU_SET_RANGE_VIEW_DETAILS.getKey()); |
| 242 | 0 | if (cluSetRangeViewDetailsData == null) { |
| 243 | 0 | cluSetRangeViewDetailsData = new Data(); |
| 244 | 0 | setCluRangeViewDetails(cluSetRangeViewDetailsData); |
| 245 | |
} |
| 246 | 0 | return cluSetRangeViewDetailsData; |
| 247 | |
} |
| 248 | |
|
| 249 | |
} |