- Type Parameters:
T
- the type of data propagated with this event
- All Superinterfaces:
Consumer<T>
,EventObserver<T>
,Runnable
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.addConsumer(this::onBoolean); event.accept(true);A factory for
Event
instances.-
Method Summary
Methods inherited from interface is.codion.common.event.EventObserver
addConsumer, addListener, addWeakConsumer, addWeakListener, removeConsumer, removeListener, removeWeakConsumer, removeWeakListener
-
Method Details
-
run
void run()Triggers this event. -
accept
Triggers this event. -
observer
EventObserver<T> observer()- Returns:
- an observer notified each time this event occurs
-
event
Creates a newEvent
.- Type Parameters:
T
- the type of data propagated to listeners on event occurrence- Returns:
- a new Event
-