Code example for EventBus

Methods: register

0
public abstract class EventSubscriber<T> { 
 
    List<T> events = new ArrayList<T>();
 
    public EventSubscriber(EventBus eventBus) {
        eventBus.register(this);
    } 
 
    public abstract void handleEvent(T event);
 
    public List<T> getHandledEvents() {
        return events;
    } 
}