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.r1.lum.lu.dto;
017    
018    import java.io.Serializable;
019    import java.util.Date;
020    import java.util.HashMap;
021    import java.util.Map;
022    
023    import javax.xml.bind.annotation.XmlAccessType;
024    import javax.xml.bind.annotation.XmlAccessorType;
025    import javax.xml.bind.annotation.XmlAttribute;
026    import javax.xml.bind.annotation.XmlElement;
027    import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
028    
029    import org.kuali.student.r1.common.dto.HasAttributes;
030    import org.kuali.student.r1.common.dto.HasTypeState;
031    import org.kuali.student.r1.common.dto.Idable;
032    import org.kuali.student.r2.common.dto.MetaInfo;
033    import org.kuali.student.core.ws.binding.JaxbAttributeMapListAdapter;
034    
035    /**
036     * Detailed information about a CLU to LO relation.
037     *
038     * @Author KSContractMojo
039     * @Author Kamal
040     * @Since Mon Jan 11 15:21:39 PST 2010
041     * @See <a href="https://test.kuali.org/confluence/display/KULSTU/cluLoRelationInfo+Structure+v1.0-rc1">CluLoRelationInfo v1.0-rc1</>
042     *
043     */
044    @XmlAccessorType(XmlAccessType.FIELD)
045    public class CluLoRelationInfo  implements Serializable, Idable, HasTypeState, HasAttributes {
046    
047        private static final long serialVersionUID = 1L;
048    
049        @XmlElement
050        private String cluId;
051    
052        @XmlElement
053        private String loId;
054    
055        @XmlElement
056        private Date effectiveDate;
057    
058        @XmlElement
059        private Date expirationDate;
060    
061        @XmlElement
062        @XmlJavaTypeAdapter(JaxbAttributeMapListAdapter.class)
063        private Map<String, String> attributes;
064    
065        @XmlElement
066        private MetaInfo metaInfo;
067    
068        @XmlAttribute
069        private String type;
070    
071        @XmlAttribute
072        private String state;
073    
074        @XmlAttribute
075        private String id;
076    
077        /**
078         * Unique identifier for a Canonical Learning Unit (CLU).
079         */
080        public String getCluId() {
081            return cluId;
082        }
083    
084        public void setCluId(String cluId) {
085            this.cluId = cluId;
086        }
087    
088        /**
089         * Unique identifier for a learning objective record.
090         */
091        public String getLoId() {
092            return loId;
093        }
094    
095        public void setLoId(String loId) {
096            this.loId = loId;
097        }
098    
099        /**
100         * Date and time that this CLU to LO relationship became effective. This is a similar concept to the effective date on enumerated values. When an expiration date has been specified, this field must be less than or equal to the expiration date.
101         */
102        public Date getEffectiveDate() {
103            return effectiveDate;
104        }
105    
106        public void setEffectiveDate(Date effectiveDate) {
107            this.effectiveDate = effectiveDate;
108        }
109    
110        /**
111         * Date and time that this CLU to LO relationship expires. This is a similar concept to the expiration date on enumerated values. If specified, this should be greater than or equal to the effective date. If this field is not specified, then no expiration date has been currently defined and should automatically be considered greater than the effective date.
112         */
113        public Date getExpirationDate() {
114            return expirationDate;
115        }
116    
117        public void setExpirationDate(Date expirationDate) {
118            this.expirationDate = expirationDate;
119        }
120    
121        /**
122         * List of key/value pairs, typically used for dynamic attributes.
123         */
124        public Map<String, String> getAttributes() {
125            if (attributes == null) {
126                attributes = new HashMap<String, String>();
127            }
128            return attributes;
129        }
130    
131        public void setAttributes(Map<String, String> attributes) {
132            this.attributes = attributes;
133        }
134    
135        /**
136         * 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.
137         */
138        public MetaInfo getMetaInfo() {
139            return metaInfo;
140        }
141    
142        public void setMetaInfo(MetaInfo metaInfo) {
143            this.metaInfo = metaInfo;
144        }
145    
146        /**
147         * Unique identifier for a clu lo relation type.
148         */
149        public String getType() {
150            return type;
151        }
152    
153        public void setType(String type) {
154            this.type = type;
155        }
156    
157        /**
158         * Identifier for the current status of a CLU to LO relationship. The values for this field are constrained to those in the luLoRelationState enumeration. A separate setup operation does not exist for retrieval of the meta data around this value.
159         */
160        public String getState() {
161            return state;
162        }
163    
164        public void setState(String state) {
165            this.state = state;
166        }
167    
168        /**
169         * Unique identifier for a single CLU LO Relation record. This is optional, due to the identifier being set at the time of creation. Once the relation has been created, this should be seen as required.
170         */
171        public String getId() {
172            return id;
173        }
174    
175        public void setId(String id) {
176            this.id = id;
177        }
178    
179        @Override
180        public String toString() {
181            return "CLuLoRelationInfo[id=" + id + ", cluId=" + cluId + ", loId=" + loId + "]";
182        }
183    
184    }