001    /**
002     * Copyright 2010 The Kuali Foundation Licensed under the
003     * Educational Community License, Version 2.0 (the "License"); you may
004     * not use this file except in compliance with the License. You may
005     * obtain a copy of the License at
006     *
007     * http://www.osedu.org/licenses/ECL-2.0
008     *
009     * Unless required by applicable law or agreed to in writing,
010     * software distributed under the License is distributed on an "AS IS"
011     * BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
012     * or implied. See the License for the specific language governing
013     * permissions and limitations under the License.
014     */
015    
016    package org.kuali.student.lum.lu.dto;
017    
018    import java.io.Serializable;
019    import java.util.HashMap;
020    import java.util.Map;
021    
022    import javax.xml.bind.annotation.XmlAccessType;
023    import javax.xml.bind.annotation.XmlAccessorType;
024    import javax.xml.bind.annotation.XmlAttribute;
025    import javax.xml.bind.annotation.XmlElement;
026    import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
027    
028    import org.kuali.student.common.dto.HasAttributes;
029    import org.kuali.student.common.dto.Idable;
030    import org.kuali.student.common.dto.MetaInfo;
031    import org.kuali.student.core.ws.binding.JaxbAttributeMapListAdapter;
032    
033    /**
034     *Detailed information about learning unit codes.
035     */ 
036    @XmlAccessorType(XmlAccessType.FIELD)
037    public class LuCodeInfo implements Serializable, Idable, HasAttributes {
038    
039        private static final long serialVersionUID = 1L;
040    
041        @XmlElement
042        private String descr;
043    
044        @XmlAttribute
045        private String type;
046    
047        @XmlElement
048        private String value;
049    
050        @XmlElement
051        @XmlJavaTypeAdapter(JaxbAttributeMapListAdapter.class)
052        private Map<String, String> attributes;
053    
054        @XmlElement
055        private MetaInfo metaInfo;
056    
057        @XmlAttribute
058        private String id;
059    
060        /**
061         * The description of the code.
062         */
063        public String getDescr() {
064            return descr;
065        }
066    
067        public void setDescr(String descr) {
068            this.descr = descr;
069        }
070    
071        /**
072         * The code's type
073         */
074        public void setType(String type) {
075            this.type = type;
076        }
077    
078        public String getType() {
079            return type;
080        }
081    
082        /**
083         * The code's value.
084         */
085        public String getValue() {
086            return value;
087        }
088    
089        public void setValue(String value) {
090            this.value = value;
091        }
092    
093        /**
094         * List of key/value pairs, typically used for dynamic attributes.
095         */
096        @Override
097        public Map<String, String> getAttributes() {
098            if (attributes == null) {
099                attributes = new HashMap<String, String>();
100            }
101            return attributes;
102        }
103    
104        @Override
105        public void setAttributes(Map<String, String> attributes) {
106            this.attributes = attributes;
107        }
108    
109        /**
110         * Create and last update info for the structure. This is optional and treated as read only since the data is set by the internals of the service during maintenance operations.
111         */
112        public MetaInfo getMetaInfo() {
113            return metaInfo;
114        }
115    
116        public void setMetaInfo(MetaInfo metaInfo) {
117            this.metaInfo = metaInfo;
118        }
119    
120        /**
121         * Unique identifier for an LU code record.
122         */
123        @Override
124        public String getId() {
125            return id;
126        }
127    
128        @Override
129        public void setId(String id) {
130            this.id = id;
131        }
132    }