@ThreadSafe public final class ThrowableX extends Object
Modifier and Type | Field and Description |
---|---|
static List<Throwable> |
ENLIST_NONE
An empty and immutable list of throwables for use with listedThrowable.
|
Modifier and Type | Method and Description |
---|---|
static boolean |
isSimilar(Throwable t1,
Throwable t2)
Returns true if both throwables are similar, or both null.
|
static List<Throwable> |
listedThrowable(Throwable x,
List<Throwable> list)
Enlists the specified throwable and returns the list.
|
static String |
toStringExpanded(Throwable t)
Contructs an expanded
toString that includes the throwable's own,
plus that of all nested causes. |
public static final List<Throwable> ENLIST_NONE
public static boolean isSimilar(Throwable t1, Throwable t2)
public static List<Throwable> listedThrowable(Throwable x, List<Throwable> list)
list
- the pre-constructed list to use. ENLIST_NONE may be specified in order to defeat enlistment and instead
force immediate throwing, but the caller is responsible for detecting and
implementing that. Passing ENLIST_NONE into this method will raise
UnsupportedOperationException.public static String toStringExpanded(Throwable t)
toString
that includes the throwable's own,
plus that of all nested causes.