|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectnet.sf.staccatocommons.io.internal.Handle
public class Handle
Utility class for handling exception in Callables
| Method Summary | ||
|---|---|---|
static
|
throwing(Callable<R> thunk,
Class<ExceptionType> exceptionClass)
Sends Callable.call() to the given callable, throwing
any exception of type exceptionClass - including subtypes - ,
and softening any exception of any other type. |
|
static
|
throwing(Callable<R> thunk,
Class<ExceptionType1> exceptionClass1,
Class<ExceptionType2> exceptionClass2)
Sends Callable.call() to the given callable, throwing
any exception of type exceptionClass1 or
exceptionClass2 - including subtypes - , and softening any
exception of any other type. |
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Method Detail |
|---|
public static <ExceptionType extends Exception,R> R throwing(Callable<R> thunk,
Class<ExceptionType> exceptionClass)
throws ExceptionType extends Exception
Callable.call() to the given callable, throwing
any exception of type exceptionClass - including subtypes - ,
and softening any exception of any other type.
ExceptionType - exceptionClass - the type of exception that will be thrown without being soften.
This class should correspond to a checked
exception type. Otherwise, this method would not provide any
benefit over sending call() directly.
Callable.call()
RuntimeException - if any exception of type different from
exceptionClass is thrown while evaluating
Callable.call().
ExceptionType extends Exception
public static <ExceptionType1 extends Exception,ExceptionType2 extends Exception,R> R throwing(Callable<R> thunk,
Class<ExceptionType1> exceptionClass1,
Class<ExceptionType2> exceptionClass2)
throws ExceptionType1 extends Exception,
ExceptionType2 extends Exception
Callable.call() to the given callable, throwing
any exception of type exceptionClass1 or
exceptionClass2 - including subtypes - , and softening any
exception of any other type.
ExceptionType1 - ExceptionType2 - exceptionClass1 - one of the two types of exceptions that will be thrown without
being soften. This class should correspond to a
checked exception type. Otherwise, this method would not provide
any benefit over sending call() directly.exceptionClass2 - the second type of exception that will be thrown without being
soften. Same restrictions of exceptionClass1 apply
Callable.call()
RuntimeException - if any exception of type different from
exceptionClass1 or exceptionClass2 is
thrown while evaluating Callable.call().
ExceptionType1 extends Exception
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||