Package VASSAL.tools
Class ThrowableUtils
java.lang.Object
VASSAL.tools.ThrowableUtils
- Since:
- 3.1.0
- Author:
- Joel Uckelman
-
Method Summary
Modifier and TypeMethodDescriptionstatic <T extends Throwable>
TgetAncestor(Class<T> cl, Throwable t)
Returns the most recentThrowable
of classT
in the proper causal history of the givenThrowable
, if one exists.static <T extends Throwable>
TReturns the most recentThrowable
of classT
in the (not necessarily proper) causal history of the givenThrowable
, if one exists.static String
getStackTrace(Throwable thrown)
static <T extends Throwable>
voidthrowAncestor(Class<T> cl, Throwable t)
Throws the most recentThrowable
of classT
in the proper causal history of the givenThrowable
, if one exists.static <T extends Throwable>
voidthrowRecent(Class<T> cl, Throwable t)
Throws the most recentThrowable
of classT
in the (not necessarily proper) causal history of the givenThrowable
, if one exists.
-
Method Details
-
getAncestor
Returns the most recentThrowable
of classT
in the proper causal history of the givenThrowable
, if one exists.- Parameters:
cl
- theClass
to search fort
- theThrowable
to check- Returns:
- the proper ancestor of class
T
, ornull
if none exists
-
getRecent
Returns the most recentThrowable
of classT
in the (not necessarily proper) causal history of the givenThrowable
, if one exists. If the givenThrowable
is of classT
, it will be returned.- Parameters:
cl
- theClass
to search fort
- theThrowable
to check- Returns:
- the ancestor of class
T
, ornull
if none exists
-
throwAncestor
Throws the most recentThrowable
of classT
in the proper causal history of the givenThrowable
, if one exists.- Parameters:
cl
- theClass
to search fort
- theThrowable
to check- Throws:
T
- if an ancestor of that class is found
-
throwRecent
Throws the most recentThrowable
of classT
in the (not necessarily proper) causal history of the givenThrowable
, if one exists.- Parameters:
cl
- theClass
to search fort
- theThrowable
to check- Throws:
T
- if an ancestor of that class is found
-
getStackTrace
- Parameters:
thrown
- theThrowable
with the stack trace to convert- Returns:
- the stack trace as a
String
-