1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 package fulmine.event;
17
18 import static fulmine.util.Utils.COLON;
19 import static fulmine.util.Utils.EMPTY_STRING;
20 import fulmine.util.reference.is;
21
22
23
24
25
26
27
28
29
30 public final class EventFrameExecution implements IEventFrameExecution
31 {
32
33 private static long counter;
34
35
36 private final String id;
37
38
39
40
41 public EventFrameExecution()
42 {
43 this(EMPTY_STRING);
44 }
45
46 public EventFrameExecution(String id)
47 {
48 synchronized (EventFrameExecution.class)
49 {
50 this.id = id + COLON + counter++;
51 }
52 }
53
54 @Override
55 public String toString()
56 {
57 return EMPTY_STRING + this.id;
58 }
59
60 @Override
61 public int hashCode()
62 {
63 final int prime = 31;
64 int result = 1;
65 result = prime * result + ((id == null) ? 0 : id.hashCode());
66 return result;
67 }
68
69 @Override
70 public boolean equals(Object obj)
71 {
72 if (is.same(this, obj))
73 {
74 return true;
75 }
76 if (is.differentClass(this, obj))
77 {
78 return false;
79 }
80 final EventFrameExecution other = (EventFrameExecution) obj;
81 return is.eq(this.id, other.id);
82 }
83 }