1 | /** |
2 | * |
3 | */ |
4 | package de.uka.ipd.sdq.sensorframework.dao.file.entities; |
5 | |
6 | import de.uka.ipd.sdq.sensorframework.dao.file.FileDAOFactory; |
7 | import de.uka.ipd.sdq.sensorframework.entities.State; |
8 | import de.uka.ipd.sdq.sensorframework.entities.dao.IDAOFactory; |
9 | |
10 | /** |
11 | * @author Ihssane El-Oudghiri |
12 | * |
13 | */ |
14 | public class StateImpl extends AbstractFileEntity implements State, SerializableEntity { |
15 | |
16 | private static final long serialVersionUID = -458584924706735994L; |
17 | private long stateID; |
18 | private String stateLiteral; |
19 | |
20 | public StateImpl(IDAOFactory factory) { |
21 | super(factory); |
22 | } |
23 | |
24 | @Override |
25 | public boolean equals(Object obj) { |
26 | if (!(obj instanceof State)) |
27 | return false; |
28 | State s = (State) obj; |
29 | if (!(stateID == s.getStateID() && stateLiteral.equals(s |
30 | .getStateLiteral()))) |
31 | return false; |
32 | return true; |
33 | } |
34 | |
35 | public String getFileName() { |
36 | return FileDAOFactory.STATE_FILE_NAME_PREFIX + getStateID(); |
37 | } |
38 | |
39 | public long getID() { |
40 | return this.stateID; |
41 | } |
42 | |
43 | public long getStateID() { |
44 | return stateID; |
45 | } |
46 | |
47 | public String getStateLiteral() { |
48 | return stateLiteral; |
49 | } |
50 | |
51 | public void serializeChildren() { |
52 | // Nothing to serialize here |
53 | } |
54 | |
55 | public void setFactory(FileDAOFactory factory) { |
56 | } |
57 | |
58 | public void setStateID(long value) { |
59 | this.stateID = value; |
60 | } |
61 | |
62 | public void setStateLiteral(String value) { |
63 | this.stateLiteral = value; |
64 | } |
65 | } |