CALLBACKTYPE - The callback type.public interface ICallbackList<CALLBACKTYPE extends ICallback> extends Serializable
ICallback objects.getAllCallbacks() directly or the returned Iterator would not be
thread-safe and that is not an option for this type.| Modifier and Type | Method and Description |
|---|---|
void |
forEach(Consumer<CALLBACKTYPE> aConsumer)
Invoke all registered callbacks in a safe manner.
|
EContinue |
forEachWithReturn(Function<CALLBACKTYPE,EContinue> aFunction)
Invoke all registered callbacks in a safe manner.
|
ICommonsList<CALLBACKTYPE> |
getAllCallbacks() |
CALLBACKTYPE |
getCallbackAtIndex(int nIndex)
Get the callback at the specified index.
|
int |
getCallbackCount() |
boolean |
hasCallbacks() |
@Nonnull @ReturnsMutableCopy ICommonsList<CALLBACKTYPE> getAllCallbacks()
null and only
containing non-null elements.@Nullable CALLBACKTYPE getCallbackAtIndex(@Nonnegative int nIndex)
nIndex - The index to be retrieved. Should be ≥ 0.null if the provided index is invalid.@Nonnegative int getCallbackCount()
boolean hasCallbacks()
true if at least a single callback is present,
false otherwise.void forEach(@Nonnull Consumer<CALLBACKTYPE> aConsumer)
aConsumer - The action to be performed with the respective callback. This method
cannot return a value. May not be null.@Nonnull EContinue forEachWithReturn(@Nonnull Function<CALLBACKTYPE,EContinue> aFunction)
aFunction - The action to be performed with the respective callback. The first
callback that returns EContinue.BREAK stops the process. May
not be null.EContinue.CONTINUE if all callbacks returned
EContinue.CONTINUE, EContinue.BREAK if at least one
invocation returned EContinue.BREAK.Copyright © 2014–2016 Philip Helger. All rights reserved.