建立一個事件物件

對於傳送和接收事件,我們首先需要一個 Event 物件。事件物件實際上是簡單的 POJO。

public class ArbitaryEvent{
    public static final int TYPE_1 = 1;
    public static final int TYPE_2 = 2;
    private int eventType;
    public ArbitaryEvent(int eventType){
        this.eventType = eventType;
    }
    
    public int getEventType(){
        return eventType;
    }
}