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    
021    import javax.xml.bind.annotation.XmlAccessType;
022    import javax.xml.bind.annotation.XmlAccessorType;
023    import javax.xml.bind.annotation.XmlElement;
024    import javax.xml.bind.annotation.XmlType;
025    
026    //import org.w3c.dom.Element;
027    
028    import org.kuali.student.r2.common.infc.Amount;
029    
030    /**
031     * Detailed information about an amount including both the type of
032     * units and the quantity.
033     *
034     * @author Kamal
035     */
036    
037    @XmlAccessorType(XmlAccessType.FIELD)
038    @XmlType(name = "AmountInfo", propOrder = {
039                    "unitTypeKey", "unitQuantity" })//, "_futureElements" }) TODO KSCM-372: Non-GWT translatable code })
040    
041    public class AmountInfo 
042        implements Amount, Serializable {
043    
044        private static final long serialVersionUID = 1L;
045    
046        @XmlElement
047        private String unitTypeKey;
048    
049        @XmlElement
050        private String unitQuantity;
051        
052    //    TODO KSCM-372: Non-GWT translatable code
053    //    @XmlAnyElement
054    //    private List<Element> _futureElements;
055    
056    
057        /**
058         * Constructs a new AmountInfo.
059         */
060        public AmountInfo() {
061        }
062        
063        /**
064         * Constructs a new AmountInfo from another Amount.
065         * 
066         * @param amount the amount to copy
067         */
068    
069        public AmountInfo(Amount amount) {
070            if (amount != null) {
071                this.unitQuantity = amount.getUnitQuantity();
072                this.unitTypeKey = amount.getUnitTypeKey();
073            }
074        }
075    
076        @Override
077        public String getUnitTypeKey() {
078            return unitTypeKey;
079        }
080    
081        public void setUnitTypeKey(String unitTypeKey) {
082            this.unitTypeKey = unitTypeKey;
083        }
084    
085        @Override
086        public String getUnitQuantity() {
087            return unitQuantity;
088        }
089    
090        public void setUnitQuantity(String unitQuantity) {
091            this.unitQuantity = unitQuantity;
092        }
093    
094        // Compatbility
095    
096    }