Package com.helger.base.callback
Interface ICallbackList<CALLBACKTYPE extends ICallback>
- Type Parameters:
CALLBACKTYPE- The callback type.
- All Known Implementing Classes:
CallbackList
public interface ICallbackList<CALLBACKTYPE extends ICallback>
extends Iterable<CALLBACKTYPE>, IHasSize
Read-only interface for a list of
Note: Does not implement Iterable because the returned iterator would either be an Iterator over the list in which case you can use
ICallback objects.Note: Does not implement Iterable because the returned iterator would either be an Iterator over the list in which case you can use
getAllCallbacks() directly or the returned Iterator
would not be thread-safe and that is not an option for this type.- Author:
- Philip Helger
-
Method Summary
Modifier and TypeMethodDescription@NonNull List<CALLBACKTYPE> @Nullable CALLBACKTYPEgetCallbackAtIndex(int nIndex) Get the callback at the specified index.Methods inherited from interface com.helger.base.iface.IHasSize
isEmpty, isNotEmpty, sizeMethods inherited from interface java.lang.Iterable
forEach, iterator, spliterator
-
Method Details
-
getAllCallbacks
- Returns:
- A list of all callbacks. Never
nulland only containing non-nullelements.
-
getCallbackAtIndex
Get the callback at the specified index.- Parameters:
nIndex- The index to be retrieved. Should be ≥ 0.- Returns:
nullif the provided index is invalid.
-