top.cutexingluo.tools.designtools.helper.TryCatchHelper Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of xingtools-core Show documentation
Show all versions of xingtools-core Show documentation
xingtools 核心,包括各种接口,实体类和工具类
package top.cutexingluo.tools.designtools.helper;
import top.cutexingluo.tools.basepackage.baseimpl.XTCallable;
import top.cutexingluo.tools.basepackage.baseimpl.XTRunnable;
import java.util.concurrent.Callable;
import java.util.function.Consumer;
import java.util.function.Supplier;
/**
* try-catch 工具 helper 类
* 1. 通过实现该接口即可使用里面的方法
*
2. 封装try-catch语句,使之结构化
*
* @author XingTian
* @version 1.0.0
* @date 2023/10/16 15:58
* @since 1.0.2
*/
public interface TryCatchHelper {
default Supplier getTrySupplier(Callable task, Supplier canRunTask, Consumer inCatch) {
return XTCallable.getTrySupplier(task, canRunTask, inCatch);
}
default Supplier getTrySupplier(Supplier task, Supplier canRunTask, Consumer inCatch) {
return XTCallable.getTrySupplier(task, canRunTask, inCatch);
}
default Callable getTryCallable(Callable task, Supplier canRunTask, Consumer inCatch) {
return XTCallable.getTryCallable(task, canRunTask, inCatch);
}
default Runnable getTtyRunnable(Runnable task, Supplier canRunTask, Consumer inCatch) {
return XTRunnable.getTryRunnable(task, canRunTask, inCatch);
}
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy