Class CollectingExceptionCallback<EXTYPE extends Throwable>

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

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

    • CollectingExceptionCallback

      public CollectingExceptionCallback()
  • Method Details

    • onException

      public void onException(@Nullable EXTYPE aEx)
      Store the passed exception.
      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 an exception was stored, false otherwise.
    • getException

      public @Nullable EXTYPE getException()
      Returns:
      The stored exception. May be null if no exception was stored.
    • toString

      public String toString()
      Overrides:
      toString in class Object