Class CollectingExceptionListCallback<EXTYPE extends Throwable>

java.lang.Object
com.helger.base.callback.exception.CollectingExceptionListCallback<EXTYPE>
Type Parameters:
EXTYPE - The exception type to be handled
All Implemented Interfaces:
IExceptionCallback<EXTYPE>, ICallback

@NotThreadSafe public class CollectingExceptionListCallback<EXTYPE extends Throwable> extends Object implements IExceptionCallback<EXTYPE>
A specific implementation of the IExceptionCallback interface, that stores all exceptions.
Author:
Philip Helger
  • Constructor Details

    • CollectingExceptionListCallback

      public CollectingExceptionListCallback()
  • Method Details

    • onException

      public void onException(@Nullable EXTYPE aEx)
      Store the passed exception. null values are ignored.
      Specified by:
      onException in interface IExceptionCallback<EXTYPE extends Throwable>
      Parameters:
      aEx - The exception to store. May be null.
    • hasException

      public boolean hasException()
      Returns:
      true if at least one exception was stored, false otherwise.
    • getExceptionCount

      @Nonnegative public int getExceptionCount()
      Returns:
      The number of stored exceptions. Always ≥ 0.
    • getAllExceptions

      @ReturnsMutableCopy public @NonNull List<EXTYPE> getAllExceptions()
      Returns:
      A mutable copy of all stored exceptions. Never null.
    • toString

      public String toString()
      Overrides:
      toString in class Object