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
016package org.kuali.student.r1.lum.lrc.dto;
017
018import java.io.Serializable;
019import java.util.Date;
020import java.util.HashMap;
021import java.util.Map;
022
023import javax.xml.bind.annotation.XmlAccessType;
024import javax.xml.bind.annotation.XmlAccessorType;
025import javax.xml.bind.annotation.XmlAttribute;
026import javax.xml.bind.annotation.XmlElement;
027import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
028
029import org.kuali.student.r1.common.dto.HasAttributes;
030import org.kuali.student.r1.common.dto.Idable;
031import org.kuali.student.r2.common.dto.RichTextInfo;
032import org.kuali.student.core.ws.binding.JaxbAttributeMapListAdapter;
033
034/**
035 * Detailed information about a credit value.
036 *
037 * @Author KSContractMojo
038 * @Author lindholm
039 * @Since Tue Apr 21 13:47:35 PDT 2009
040 * @See <a href="https://test.kuali.org/confluence/display/KULSTU/creditInfo+Structure">CreditInfo</>
041 *
042 */
043@XmlAccessorType(XmlAccessType.FIELD)
044public class CreditInfo implements Serializable, Idable, HasAttributes {
045
046    private static final long serialVersionUID = 1L;
047
048    @XmlElement
049    private String name;
050
051    @XmlElement
052    private RichTextInfo desc;
053
054    @XmlElement
055    private String value;
056
057    @XmlElement
058    private Date effectiveDate;
059
060    @XmlElement
061    private Date expirationDate;
062
063    @XmlElement
064    @XmlJavaTypeAdapter(JaxbAttributeMapListAdapter.class)
065    private Map<String, String> attributes;
066
067    @XmlAttribute
068    private String type;
069
070    @XmlAttribute
071    private String id;
072
073    /**
074     * Name of this credit. This may have a direct relation to the combination of value and type fields.
075     */
076    public String getName() {
077        return name;
078    }
079
080    public void setName(String name) {
081        this.name = name;
082    }
083
084    /**
085     * Description of this credit.
086     */
087    public RichTextInfo getDesc() {
088        return desc;
089    }
090
091    public void setDesc(RichTextInfo desc) {
092        this.desc = desc;
093    }
094
095    /**
096     * Value of the credit. This may be numeric based on the type of credit (ex. academic credit hours could be an integer).
097     */
098    public String getValue() {
099        return value;
100    }
101
102    public void setValue(String value) {
103        this.value = value;
104    }
105
106    /**
107     * Date and time that this credit value 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.
108     */
109    public Date getEffectiveDate() {
110        return effectiveDate;
111    }
112
113    public void setEffectiveDate(Date effectiveDate) {
114        this.effectiveDate = effectiveDate;
115    }
116
117    /**
118     * Date and time that this credit value 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.
119     */
120    public Date getExpirationDate() {
121        return expirationDate;
122    }
123
124    public void setExpirationDate(Date expirationDate) {
125        this.expirationDate = expirationDate;
126    }
127
128    /**
129     * List of key/value pairs, typically used for dynamic attributes.
130     */
131    public Map<String, String> getAttributes() {
132        if (attributes == null) {
133            attributes = new HashMap<String, String>();
134        }
135        return attributes;
136    }
137
138    public void setAttributes(Map<String, String> attributes) {
139        this.attributes = attributes;
140    }
141
142    /**
143     * Unique identifier for a credit type.
144     */
145    public String getType() {
146        return type;
147    }
148
149    public void setType(String type) {
150        this.type = type;
151    }
152
153    /**
154     * The page creditId Structure does not exist.
155     */
156    public String getId() {
157        return id;
158    }
159
160    public void setId(String id) {
161        this.id = id;
162    }
163}