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.XmlAttribute;
022    import javax.xml.bind.annotation.XmlTransient;
023    
024    import org.kuali.student.r2.common.infc.IdEntity;
025    
026    /**
027     * Information for entities identified by an Id.
028     * 
029     * @author Kuali Student Team (sambit)
030     */
031    
032    @SuppressWarnings("serial")
033    @XmlTransient
034    public abstract class IdEntityInfo 
035        extends EntityInfo 
036        implements IdEntity, Serializable {
037    
038        @XmlAttribute
039        private String id;
040    
041        
042        /**
043         * Constructs a new IdEntityInfo.
044         */
045        protected IdEntityInfo() {
046        }
047    
048        /**
049         * Constructs a new IdEntityInfo from another IdEntity.
050         *
051         * @param idEntity the IdEntity to copy
052         */
053        public IdEntityInfo(IdEntity idEntity) {
054            super(idEntity);
055            
056            if (idEntity != null) {
057                this.id = idEntity.getId();
058            }
059        }
060    
061        @Override
062        public String getId() {
063            return id;
064        }
065        
066        public void setId(String id) {
067            this.id = id;
068        }
069    }