Package org.aoju.bus.core.lang.function
Interface VoidFunc1<P>
- Type Parameters:
P- 参数类型
- All Superinterfaces:
Serializable
- Functional Interface:
- This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.
函数对象
一个函数接口代表一个一个函数,用于包装一个函数为对象
在JDK8之前,Java的函数并不能作为参数传递,也不能作为返回值存在
此接口用于将一个函数包装成为一个对象,从而传递对象
- Since:
- Java 17+
- Author:
- Kimi Liu
-
Method Summary
Modifier and TypeMethodDescriptionvoid执行函数default voidcallWithRuntimeException(P parameter) 执行函数,异常包装为RuntimeException
-
Method Details
-
call
执行函数- Parameters:
parameter- 参数- Throws:
Exception- 自定义异常
-
callWithRuntimeException
执行函数,异常包装为RuntimeException- Parameters:
parameter- 参数
-