| Access | Constructor and Description |
|---|---|
| public | ExceptionDepthComparator(Throwable
the target exception to compare to when sorting by depth exception)Create a new ExceptionDepthComparator for the given exception. |
| public | ExceptionDepthComparator(Class<? extends Throwable>
the target exception type to compare to when sorting by depth exceptionType)Create a new ExceptionDepthComparator for the given exception type. |
| Modifier and Type | Method and Description |
|---|---|
| public int | |
| public static Class | Returns: the closest matching exception type from the given collectionthe collection of exception types exceptionTypes, Throwable the target exception to find a match for targetException)Obtain the closest match from the given exception types for the given target exception. |
| private int |
| targetException | back to summary |
|---|---|
| private final Class<? extends Throwable> targetException | |
| ExceptionDepthComparator | back to summary |
|---|---|
| public ExceptionDepthComparator(Throwable exception) Create a new ExceptionDepthComparator for the given exception.
| |
| ExceptionDepthComparator | back to summary |
|---|---|
| public ExceptionDepthComparator(Class<? extends Throwable> exceptionType) Create a new ExceptionDepthComparator for the given exception type. | |
| compare | back to summary |
|---|---|
| public int compare(Class<? extends Throwable> o1, Class<? extends Throwable> o2) Implements java. Doc from java. Compares its two arguments for order. Returns a negative integer, zero, or a positive integer as the first argument is less than, equal to, or greater than the second.
The implementor must ensure that
The implementor must also ensure that the relation is transitive:
Finally, the implementor must ensure that | |
| findClosestMatch | back to summary |
|---|---|
| public static Class Obtain the closest match from the given exception types for the given target exception. | |
| getDepth | back to summary |
|---|---|
| private int getDepth(Class<?> declaredException, Class<?> exceptionToMatch, int depth) | |