接口 ThrowableAction
-
- 函数接口:
- 这是一个函数接口, 因此可用作 lambda 表达式或方法引用的赋值目标。
@FunctionalInterface public interface ThrowableAction
A function interface for action withThrowable
- 从以下版本开始:
- 1.0.0
- 另请参阅:
Function
,Throwable
-
-
方法概要
所有方法 静态方法 实例方法 抽象方法 默认方法 修饰符和类型 方法 说明 void
execute()
Executes the actionstatic void
execute(ThrowableAction action)
ExecutesThrowableAction
withthe default exception handling
static void
execute(ThrowableAction action, java.util.function.Consumer<java.lang.Throwable> exceptionHandler)
ExecutesThrowableAction
with the customizedexception
handlingdefault void
execute(java.util.function.Consumer<java.lang.Throwable> exceptionHandler)
Executesexecute()
with the customizedexception
handlingdefault void
handleException(java.lang.Throwable failure)
Handle any exception that theexecute()
method throws
-
-
-
方法详细资料
-
execute
void execute() throws java.lang.Throwable
Executes the action- 抛出:
java.lang.Throwable
- if met with error
-
execute
default void execute(java.util.function.Consumer<java.lang.Throwable> exceptionHandler)
Executesexecute()
with the customizedexception
handling- 参数:
exceptionHandler
- the handler to handle anyexception
that theexecute()
method throws- 抛出:
java.lang.NullPointerException
- ifexceptionHandler
isnull
-
handleException
default void handleException(java.lang.Throwable failure)
Handle any exception that theexecute()
method throws- 参数:
failure
- the instance ofThrowable
-
execute
static void execute(ThrowableAction action)
ExecutesThrowableAction
withthe default exception handling
- 参数:
action
-ThrowableAction
- 抛出:
java.lang.NullPointerException
- ifaction
isnull
-
execute
static void execute(ThrowableAction action, java.util.function.Consumer<java.lang.Throwable> exceptionHandler) throws java.lang.NullPointerException
ExecutesThrowableAction
with the customizedexception
handling- 参数:
action
-ThrowableAction
exceptionHandler
- the handler to handle anyexception
that theexecute()
method throws- 抛出:
java.lang.NullPointerException
- ifaction
orexceptionHandler
isnull
-
-