Subversion Repositories SmartDukaan

Rev

Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
10 shop2020 1
/**
2
 * 
3
 */
4
package in.shop2020.metamodel.definitions;
5
 
6
import in.shop2020.metamodel.core.Entity;
7
 
8
import java.io.Serializable;
9
import java.util.HashMap;
10
import java.util.Map;
11
 
12
/**
13
 * @author naveen
14
 *
15
 */
16
public class EntityContainer implements Serializable {
17
 
18
	/**
19
	 * 
20
	 */
21
	private static final long serialVersionUID = 1L;
22
 
23
	/**
24
	 * 
25
	 */
26
	private Map<Long, Entity> entities;
27
 
28
	/**
29
	 * 
30
	 */
31
	public EntityContainer() {
32
		this.entities = new HashMap<Long, Entity>();
33
	}
34
 
35
	/**
36
	 * 
37
	 * @return Map
38
	 */
39
	public Map<Long, Entity> getEntities() {
40
		return this.entities;
41
	}
42
 
43
	/**
44
	 * 
45
	 * @param value
46
	 */
47
	public void setEntities(Map<Long, Entity> value) {
48
		this.entities = value;
49
	}
50
 
51
	/**
52
	 * 
53
	 * @param entityID
54
	 * @return Entity
55
	 */
56
	public Entity getEntity(long entityID) {
57
		return this.entities.get(new Long(entityID));
58
	}
59
 
60
	/**
61
	 * 
62
	 * @param newEntity
63
	 */
64
	public void addEntity(Entity newEntity) {
65
		this.entities.put(new Long(newEntity.getID()), newEntity);
66
	}
67
 
68
	/**
69
	 * 
70
	 * @param entityID
71
	 */
72
	public void removeEntity(long entityID) {
73
		this.entities.remove(new Long(entityID));
74
	}
75
}