1 | |
package org.kuali.student.lum.common.client.widgets; |
2 | |
|
3 | |
import org.kuali.student.common.assembly.data.Data; |
4 | |
import org.kuali.student.common.assembly.helper.PropertyEnum; |
5 | |
|
6 | |
public class CluSetRangeHelper { |
7 | |
|
8 | 0 | public enum Properties implements PropertyEnum |
9 | |
{ |
10 | 0 | ID ("id"), |
11 | 0 | SEARCH_TYPE_KEY ("searchTypeKey"), |
12 | 0 | QUERY_PARAMS ("queryParams"); |
13 | |
|
14 | |
|
15 | |
private final String key; |
16 | |
|
17 | 0 | private Properties (final String key) { |
18 | 0 | this.key = key; |
19 | 0 | } |
20 | |
|
21 | |
@Override |
22 | |
public String getKey() { |
23 | 0 | return this.key; |
24 | |
} |
25 | |
} |
26 | |
|
27 | |
private Data data; |
28 | |
|
29 | 0 | public CluSetRangeHelper(Data data) { |
30 | 0 | this.data = data; |
31 | 0 | } |
32 | |
|
33 | |
public static CluSetRangeHelper wrap(Data data) { |
34 | 0 | if (data == null) { |
35 | 0 | return null; |
36 | |
} |
37 | 0 | return new CluSetRangeHelper(data); |
38 | |
} |
39 | |
|
40 | |
public void setId(String value) { |
41 | 0 | data.set(Properties.ID.getKey(), value); |
42 | 0 | } |
43 | |
|
44 | |
public String getId() { |
45 | 0 | return data.get(Properties.ID.getKey()); |
46 | |
} |
47 | |
|
48 | |
public void setSearchTypeKey(String value) { |
49 | 0 | data.set(Properties.SEARCH_TYPE_KEY.getKey(), value); |
50 | 0 | } |
51 | |
|
52 | |
public String getSearchTypeKey() { |
53 | 0 | return data.get(Properties.SEARCH_TYPE_KEY.getKey()); |
54 | |
} |
55 | |
|
56 | |
public void setQueryParams(Data value) { |
57 | 0 | data.set(Properties.QUERY_PARAMS.getKey(), value); |
58 | 0 | } |
59 | |
public Data getQueryParams() { |
60 | 0 | Data queryParams = data.get(Properties.QUERY_PARAMS.getKey()); |
61 | 0 | if (queryParams == null) { |
62 | 0 | queryParams = new Data(); |
63 | 0 | setQueryParams(queryParams); |
64 | |
} |
65 | 0 | return queryParams; |
66 | |
} |
67 | |
|
68 | |
public Data getData() { |
69 | 0 | return data; |
70 | |
} |
71 | |
} |