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 Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionintbooleanvoidonException(@Nullable EXTYPE aEx) Store the passed exception.toString()
-
Constructor Details
-
CollectingExceptionListCallback
public CollectingExceptionListCallback()
-
-
Method Details
-
onException
Store the passed exception.nullvalues are ignored.- Specified by:
onExceptionin interfaceIExceptionCallback<EXTYPE extends Throwable>- Parameters:
aEx- The exception to store. May benull.
-
hasException
public boolean hasException()- Returns:
trueif at least one exception was stored,falseotherwise.
-
getExceptionCount
@Nonnegative public int getExceptionCount()- Returns:
- The number of stored exceptions. Always ≥ 0.
-
getAllExceptions
- Returns:
- A mutable copy of all stored exceptions. Never
null.
-
toString
-