Interface ICallbackList<CALLBACKTYPE extends ICallback>

Type Parameters:
CALLBACKTYPE - The callback type.
All Superinterfaces:
IHasSize, Iterable<CALLBACKTYPE>
All Known Implementing Classes:
CallbackList

public interface ICallbackList<CALLBACKTYPE extends ICallback> extends Iterable<CALLBACKTYPE>, IHasSize
Read-only interface for a list of 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 Details

    • getAllCallbacks

      @ReturnsMutableCopy @NonNull List<CALLBACKTYPE> getAllCallbacks()
      Returns:
      A list of all callbacks. Never null and only containing non-null elements.
    • getCallbackAtIndex

      @Nullable CALLBACKTYPE getCallbackAtIndex(@Nonnegative int nIndex)
      Get the callback at the specified index.
      Parameters:
      nIndex - The index to be retrieved. Should be ≥ 0.
      Returns:
      null if the provided index is invalid.