C - the type of ICallbackP - the type of ICallback.ICallbackPredicateV - the type of the return value for the ICallbackpublic class CallbackRegistry<C extends ICallback<V>,P extends ICallback.ICallbackPredicate,V>
extends java.lang.Object
CallbackRegistry allows the registration and processing of ICallbacks.ICallback.| Modifier and Type | Field and Description |
|---|---|
protected java.util.List<org.apache.commons.lang3.tuple.Pair<C,ICallback.CallbackOption<P>>> |
callbacks
List of registered
ICallback. |
protected java.util.function.BiFunction<CallbackResult<V>,CallbackResult<V>,CallbackResult<V>> |
reduce |
| Constructor and Description |
|---|
CallbackRegistry() |
| Modifier and Type | Method and Description |
|---|---|
CallbackResult<V> |
processCallbacks(java.lang.Object... params)
Processes the registered
ICallbacks according to their priority. |
void |
reduce(java.util.function.BiFunction<CallbackResult<V>,CallbackResult<V>,CallbackResult<V>> reduce) |
void |
registerCallback(C callback,
ICallback.CallbackOption<P> option)
Registers a
ICallback to be call when the ICallback.ICallbackPredicate returns true. |
protected java.util.List<org.apache.commons.lang3.tuple.Pair<C extends ICallback<V>,ICallback.CallbackOption<P extends ICallback.ICallbackPredicate>>> callbacks
ICallback.protected java.util.function.BiFunction<CallbackResult<V>,CallbackResult<V>,CallbackResult<V>> reduce
public void reduce(java.util.function.BiFunction<CallbackResult<V>,CallbackResult<V>,CallbackResult<V>> reduce)
public void registerCallback(C callback, ICallback.CallbackOption<P> option)
ICallback to be call when the ICallback.ICallbackPredicate returns true.callback - the callbackoption - the optionpublic CallbackResult<V> processCallbacks(java.lang.Object... params)
ICallbacks according to their priority.params - the params