com.notifier.dispatchers.DispatchingTask Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of notifier Show documentation
Show all versions of notifier Show documentation
A generic event dispatching library
package com.notifier.dispatchers;
import com.notifier.Event;
import com.notifier.Listener;
import java.util.function.BiConsumer;
class DispatchingTask implements Runnable {
private final Listener mListener;
private final Event mEvent;
private final BiConsumer mListenerCall;
DispatchingTask(Listener listener, Event event, BiConsumer listenerCall) {
mListener = listener;
mEvent = event;
mListenerCall = listenerCall;
}
@Override
public void run() {
mListenerCall.accept(mListener, mEvent);
}
}