Subversion Repositories SmartDukaan

Rev

Blame | Last modification | View Log | RSS feed

/**
 * 
 */
package in.shop2020.metamodel.definitions;

import in.shop2020.metamodel.core.Entity;

import java.io.Serializable;
import java.util.HashMap;
import java.util.Map;

/**
 * @author naveen
 *
 */
public class EntityContainer implements Serializable {

        /**
         * 
         */
        private static final long serialVersionUID = 1L;
        
        /**
         * 
         */
        private Map<Long, Entity> entities;
        
        /**
         * 
         */
        public EntityContainer() {
                this.entities = new HashMap<Long, Entity>();
        }
        
        /**
         * 
         * @return Map
         */
        public Map<Long, Entity> getEntities() {
                return this.entities;
        }
        
        /**
         * 
         * @param value
         */
        public void setEntities(Map<Long, Entity> value) {
                this.entities = value;
        }
        
        /**
         * 
         * @param entityID
         * @return Entity
         */
        public Entity getEntity(long entityID) {
                return this.entities.get(new Long(entityID));
        }
        
        /**
         * 
         * @param newEntity
         */
        public void addEntity(Entity newEntity) {
                this.entities.put(new Long(newEntity.getID()), newEntity);
        }
        
        /**
         * 
         * @param entityID
         */
        public void removeEntity(long entityID) {
                this.entities.remove(new Long(entityID));
        }
}