All Downloads are FREE. Search and download functionalities are using the official Maven repository.

top.cutexingluo.tools.designtools.helper.TryCatchHelper Maven / Gradle / Ivy

There is a newer version: 1.1.6
Show newest version
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