Interface Event<T>

  • Type Parameters:
    T - the type of data propagated with this event
    All Superinterfaces:
    EventDataListener<T>, EventListener, EventObserver<T>

    public interface Event<T>
    extends EventListener, EventDataListener<T>, EventObserver<T>
    An event class. Listeners are notified in the order they were added.
     Event<Boolean> event = Event.event();
    
     EventObserver<Boolean> observer = event.observer();
    
     observer.addListener(this::doSomething);
     observer.addDataListener(this::onBoolean);
    
     event.onEvent(true);
     
    A factory class for Event instances.