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 Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription@Nullable EXTYPEbooleanvoidonException(@Nullable EXTYPE aEx) Store the passed exception.toString()
-
Constructor Details
-
CollectingExceptionCallback
public CollectingExceptionCallback()
-
-
Method Details
-
onException
Store the passed exception.- Specified by:
onExceptionin interfaceIExceptionCallback<EXTYPE extends Throwable>- Parameters:
aEx- The exception to store. May benull.
-
hasException
public boolean hasException()- Returns:
trueif an exception was stored,falseotherwise.
-
getException
- Returns:
- The stored exception. May be
nullif no exception was stored.
-
toString
-