Add Callback Event Handling #26

Merged
kske merged 3 commits from f/callback-handler into develop 2021-11-05 08:49:07 +01:00
Showing only changes of commit c614beb063 - Show all commits

View File

@ -9,7 +9,7 @@ import java.util.function.Consumer;
* @author Kai S. K. Engelbart * @author Kai S. K. Engelbart
* @since 1.2.0 * @since 1.2.0
*/ */
public class CallbackEventHandler implements EventHandler { public final class CallbackEventHandler implements EventHandler {
kske marked this conversation as resolved Outdated
Outdated
Review

final?

final?
private final Class<?> eventType; private final Class<?> eventType;
private final Consumer<Object> callback; private final Consumer<Object> callback;
delvh marked this conversation as resolved
Review

What about Consumer ?

What about Consumer<?> ?
Review

This wouldn't work, as `callback.accept(event)' would complain about an incompatible argument type.

This wouldn't work, as `callback.accept(event)' would complain about an incompatible argument type.