Simple event handler written in Java 8
EventHandler handler = new EventHandler();
[...]
handler.register(new Listener());
[...]
handler.handle(new TestEvent(42));
class Listener implements EventListener {
@Event
public void onTest(TestEvent event) {
System.out.println("Event has been called!");
TEST_RESULT = event.value;
}
}
class TestEvent implements BasicEvent {
private int value;
public TestEvent(int value) {
this.value = value;
}
}
See SimpleTest
For maven/gradle releases see Jitpack