public class ExceptionDepthComparator extends Object implements Comparator<Class<? extends Throwable>>
| 构造器和说明 |
|---|
ExceptionDepthComparator(Class<? extends Throwable> exceptionType)
Create a new ExceptionDepthComparator for the given exception type.
|
ExceptionDepthComparator(Throwable exception)
Create a new ExceptionDepthComparator for the given exception.
|
| 限定符和类型 | 方法和说明 |
|---|---|
int |
compare(Class<? extends Throwable> o1,
Class<? extends Throwable> o2) |
static Class<? extends Throwable> |
findClosestMatch(Collection<Class<? extends Throwable>> exceptionTypes,
Throwable targetException)
Obtain the closest match from the given exception types for the given target exception.
|
public ExceptionDepthComparator(Throwable exception)
exception - the target exception to compare to when sorting by depthpublic int compare(Class<? extends Throwable> o1, Class<? extends Throwable> o2)
compare 在接口中 Comparator<Class<? extends Throwable>>public static Class<? extends Throwable> findClosestMatch(Collection<Class<? extends Throwable>> exceptionTypes, Throwable targetException)
exceptionTypes - the collection of exception typestargetException - the target exception to find a match for