CALLBACKTYPE - The callback type.public interface ICallbackList<CALLBACKTYPE extends ICallback> extends ICommonsIterable<CALLBACKTYPE>, 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<? super CALLBACKTYPE> aConsumer)
Invoke all registered callbacks in a safe manner.
|
default EContinue |
forEachWithReturn(Function<? super CALLBACKTYPE,EContinue> aFunction)
Deprecated.
|
ICommonsList<CALLBACKTYPE> |
getAllCallbacks() |
CALLBACKTYPE |
getCallbackAtIndex(int nIndex)
Get the callback at the specified index.
|
int |
getCallbackCount() |
boolean |
hasCallbacks() |
containsAny, containsNone, containsOnly, findAll, findAllInstanceOf, findAllMapped, findAllMapped, findAllMapped, findFirst, findFirst, findFirstMapped, findFirstMapped, forEach, forEach, forEachBreakable, getIteratorCount, getIteratorCountiterator, spliterator@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<? super CALLBACKTYPE> aConsumer)
forEach in interface Iterable<CALLBACKTYPE extends ICallback>aConsumer - The action to be performed with the respective callback. This method
cannot return a value. May not be null.@Nonnull @Deprecated default EContinue forEachWithReturn(@Nonnull Function<? super 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.