forked from actframework/actframework
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathActEventListenerBase.java
More file actions
45 lines (37 loc) · 1010 Bytes
/
ActEventListenerBase.java
File metadata and controls
45 lines (37 loc) · 1010 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
package act.event;
import act.Act;
import act.app.event.AppEventListener;
import act.util.DestroyableBase;
import org.osgl.util.S;
import java.util.EventObject;
public abstract class ActEventListenerBase<EVENT_TYPE extends EventObject> extends DestroyableBase implements ActEventListener<EVENT_TYPE> {
private String id;
public ActEventListenerBase(CharSequence id) {
if (null == id) {
id = S.uuid();
}
this.id = id.toString();
}
public ActEventListenerBase() {
this(S.uuid());
}
@Override
public String id() {
return id;
}
@Override
public int hashCode() {
return id.hashCode();
}
@Override
public final boolean equals(Object obj) {
if (this == obj) {
return true;
}
if (obj instanceof AppEventListener) {
AppEventListener that = (AppEventListener) obj;
return S.eq(that.id(), this.id());
}
return false;
}
}