001 /*
002 * Copyright 2010 The Kuali Foundation
003 *
004 * Licensed under the Educational Community License, Version 2.0 (the "License");
005 * you may not use this file except in compliance with the License.
006 * You may obtain a copy of the License at
007 *
008 * http://www.osedu.org/licenses/ECL-2.0
009 *
010 * Unless required by applicable law or agreed to in writing, software
011 * distributed under the License is distributed on an "AS IS" BASIS,
012 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
013 * See the License for the specific language governing permissions and
014 * limitations under the License.
015 */
016 package org.kuali.student.lum.common.client.lo;
017
018
019 import org.kuali.student.r1.common.assembly.data.Data;
020 import org.kuali.student.r1.common.assembly.helper.PropertyEnum;
021
022
023 public class LoInfoHelper {
024 private Data data;
025
026 public enum Properties implements PropertyEnum {
027 NAME("name"),
028 DESCR("descr"),
029 ID("id"),
030 SEQUENCE("sequence"),
031 META("meta");
032
033 private final String key;
034
035 private Properties(final String key) {
036 this.key = key;
037 }
038
039 @Override
040 public String getKey() {
041 return this.key;
042 }
043 }
044
045 public LoInfoHelper() {
046 data = new Data();
047 }
048
049 public LoInfoHelper(Data data) {
050 this.data = data;
051 }
052
053 public Data getData() {
054 return data;
055 }
056
057 public void setData(Data data) {
058 this.data = data;
059 }
060
061 public void setName(String name) {
062 data.set(LoInfoHelper.Properties.NAME.getKey(), name);
063 }
064
065 public String getName() {
066 return (String) data.get(Properties.NAME.getKey());
067 }
068
069 public void setDescr(Data descData) {
070 HelperUtil.setDataField(LoInfoHelper.Properties.DESCR, data, descData);
071 }
072
073 public Data getDescr() {
074 return HelperUtil.getDataField(LoInfoHelper.Properties.DESCR, data);
075 }
076
077 public void setId(String id) {
078 data.set(LoInfoHelper.Properties.ID.getKey(), id);
079 }
080
081 public String getId() {
082 return (String) data.get(LoInfoHelper.Properties.ID.getKey());
083 }
084
085 public void setSequence(String sequence) {
086 data.set(LoInfoHelper.Properties.SEQUENCE.getKey(), sequence);
087 }
088
089 public String getSequence() {
090 return (String) data.get(LoInfoHelper.Properties.SEQUENCE.getKey());
091 }
092
093 public void setMeta(Data metaData) {
094 HelperUtil.setDataField(LoInfoHelper.Properties.META, data, metaData);
095 }
096
097 public Data getMeta() {
098 return HelperUtil.getDataField(LoInfoHelper.Properties.META, data);
099 }
100
101 }