001package org.kuali.student.lum.common.client.widgets;
002
003import org.kuali.student.r1.common.assembly.data.Data;
004import org.kuali.student.r1.common.assembly.helper.PropertyEnum;
005
006public class CluSetRangeHelper {
007
008    public enum Properties implements PropertyEnum
009    {
010        ID ("id"),
011        SEARCH_TYPE_KEY ("searchTypeKey"),
012        QUERY_PARAMS ("queryParams");
013
014        
015        private final String key;
016
017        private Properties (final String key) {
018            this.key = key;
019        }
020
021        @Override
022        public String getKey() {
023            return this.key;
024        }
025    }
026    
027    private Data data;
028    
029    public CluSetRangeHelper(Data data) {
030        this.data = data;
031    }
032    
033    public static CluSetRangeHelper wrap(Data data) {
034        if (data == null) {
035            return null;
036        }
037        return new CluSetRangeHelper(data);
038    }
039
040    public void setId(String value) {
041        data.set(Properties.ID.getKey(), value);
042    }
043    
044    public String getId() {
045        return data.get(Properties.ID.getKey());
046    }
047
048    public void setSearchTypeKey(String value) {
049        data.set(Properties.SEARCH_TYPE_KEY.getKey(), value);
050    }
051    
052    public String getSearchTypeKey() {
053        return data.get(Properties.SEARCH_TYPE_KEY.getKey());
054    }
055    
056    public void setQueryParams(Data value) {
057        data.set(Properties.QUERY_PARAMS.getKey(), value);
058    }
059    public Data getQueryParams() {
060        Data queryParams = data.get(Properties.QUERY_PARAMS.getKey());
061        if (queryParams == null) {
062            queryParams = new Data();
063            setQueryParams(queryParams);
064        }
065        return queryParams;
066    }
067    
068    public Data getData() {
069        return data;
070    }
071}