001    /**
002     * Copyright 2010 The Kuali Foundation 
003     *
004     * Licensed under the Educational Community License, Version 2.0 (the
005     * "License"); you may not use this file except in compliance with the
006     * License. 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
013     * implied. See the License for the specific language governing
014     * permissions and limitations under the License.
015     */
016    
017    package org.kuali.student.r2.common.dto;
018    
019    import java.io.Serializable;
020    import java.util.List;
021    
022    import javax.xml.bind.annotation.XmlAccessType;
023    import javax.xml.bind.annotation.XmlAccessorType;
024    import javax.xml.bind.annotation.XmlAnyElement;
025    import javax.xml.bind.annotation.XmlElement;
026    import javax.xml.bind.annotation.XmlType;
027    
028    import org.kuali.student.r2.common.infc.TimeAmount;
029    //import org.w3c.dom.Element;
030    
031    /**
032     * Information about a time amount.
033     *
034     * @author tom
035     */
036    
037    @XmlAccessorType(XmlAccessType.FIELD)
038    @XmlType(name = "TimeAmountInfo", propOrder = {
039                     "atpDurationTypeKey", "timeQuantity" })//, "_futureElements" }) TODO KSCM-372: Non-GWT translatable code})
040    
041    public class TimeAmountInfo 
042        implements TimeAmount, Serializable {
043            
044        private static final long serialVersionUID = 1L;
045        
046        @XmlElement
047        private String atpDurationTypeKey; 
048        
049        @XmlElement
050        private Integer timeQuantity; 
051        
052    //    TODO KSCM-372: Non-GWT translatable code
053    //    @XmlAnyElement
054    //    private List<Element> _futureElements;    
055        
056        
057        /**
058         * Constructs a new TimeAmountInfo.
059         */
060        public TimeAmountInfo() {
061        }
062        
063        /**
064         * Constructs a new TimeAmountInfo from another TimeAmount.
065         *
066         * @param timeAmount the TimeAmount to copy
067         */
068        public TimeAmountInfo(TimeAmount timeAmount) {           
069            
070            if (timeAmount != null) {
071                this.atpDurationTypeKey = timeAmount.getAtpDurationTypeKey();
072                this.timeQuantity = timeAmount.getTimeQuantity();
073            }
074        }
075    
076        @Override
077        public String getAtpDurationTypeKey(){
078            return atpDurationTypeKey;
079        }
080    
081        public void setAtpDurationTypeKey(String atpDurationTypeKey) {
082            this.atpDurationTypeKey = atpDurationTypeKey;
083        }
084            
085        @Override
086        public Integer getTimeQuantity(){
087            return timeQuantity;
088        }
089    
090        public void setTimeQuantity(Integer timeQuantity) {
091            this.timeQuantity = timeQuantity;
092        }
093    }