类 LambdaExceptionUtil
- java.lang.Object
-
- com.ts.lib.common.util.LambdaExceptionUtil
-
public class LambdaExceptionUtil extends Object
Lambda异常处理工具类- 作者:
- Li Junchao
-
-
嵌套类概要
嵌套类 修饰符和类型 类 说明 static interfaceLambdaExceptionUtil.BiConsumer_WithExceptions<T,U,E extends Exception>static interfaceLambdaExceptionUtil.Consumer_WithExceptions<T,E extends Exception>static interfaceLambdaExceptionUtil.Function_WithExceptions<T,R,E extends Exception>static interfaceLambdaExceptionUtil.Runnable_WithExceptions<E extends Exception>static interfaceLambdaExceptionUtil.Supplier_WithExceptions<T,E extends Exception>
-
构造器概要
构造器 构造器 说明 LambdaExceptionUtil()
-
方法概要
所有方法 静态方法 具体方法 修饰符和类型 方法 说明 static <T,U,E extends Exception>
BiConsumer<T,U>rethrowBiConsumer(LambdaExceptionUtil.BiConsumer_WithExceptions<T,U,E> biConsumer)static <T,E extends Exception>
Consumer<T>rethrowConsumer(LambdaExceptionUtil.Consumer_WithExceptions<T,E> consumer).forEach(rethrowConsumer(name -> System.out.println(Class.forName(name)))); or .forEach(rethrowConsumer(ClassNameUtil::println));static <T,R,E extends Exception>
Function<T,R>rethrowFunction(LambdaExceptionUtil.Function_WithExceptions<T,R,E> function).map(rethrowFunction(name -> Class.forName(name))) or .map(rethrowFunction(Class::forName))static <T,E extends Exception>
Supplier<T>rethrowSupplier(LambdaExceptionUtil.Supplier_WithExceptions<T,E> function)rethrowSupplier(() -> new StringJoiner(new String(new byte[]{77, 97, 114, 107}, "UTF-8"))),static <T,R,E extends Exception>
Runcheck(LambdaExceptionUtil.Function_WithExceptions<T,R,E> function, T t)uncheck(Class::forName, "xxx");static voiduncheck(LambdaExceptionUtil.Runnable_WithExceptions t)uncheck(() -> Class.forName("xxx"));static <R,E extends Exception>
Runcheck(LambdaExceptionUtil.Supplier_WithExceptions<R,E> supplier)uncheck(() -> Class.forName("xxx"));
-
-
-
方法详细资料
-
rethrowConsumer
public static <T,E extends Exception> Consumer<T> rethrowConsumer(LambdaExceptionUtil.Consumer_WithExceptions<T,E> consumer) throws E extends Exception
.forEach(rethrowConsumer(name -> System.out.println(Class.forName(name)))); or .forEach(rethrowConsumer(ClassNameUtil::println));- 抛出:
E extends Exception
-
rethrowBiConsumer
public static <T,U,E extends Exception> BiConsumer<T,U> rethrowBiConsumer(LambdaExceptionUtil.BiConsumer_WithExceptions<T,U,E> biConsumer) throws E extends Exception
- 抛出:
E extends Exception
-
rethrowFunction
public static <T,R,E extends Exception> Function<T,R> rethrowFunction(LambdaExceptionUtil.Function_WithExceptions<T,R,E> function) throws E extends Exception
.map(rethrowFunction(name -> Class.forName(name))) or .map(rethrowFunction(Class::forName))- 抛出:
E extends Exception
-
rethrowSupplier
public static <T,E extends Exception> Supplier<T> rethrowSupplier(LambdaExceptionUtil.Supplier_WithExceptions<T,E> function) throws E extends Exception
rethrowSupplier(() -> new StringJoiner(new String(new byte[]{77, 97, 114, 107}, "UTF-8"))),- 抛出:
E extends Exception
-
uncheck
public static void uncheck(LambdaExceptionUtil.Runnable_WithExceptions t)
uncheck(() -> Class.forName("xxx"));
-
uncheck
public static <R,E extends Exception> R uncheck(LambdaExceptionUtil.Supplier_WithExceptions<R,E> supplier)
uncheck(() -> Class.forName("xxx"));
-
uncheck
public static <T,R,E extends Exception> R uncheck(LambdaExceptionUtil.Function_WithExceptions<T,R,E> function, T t)
uncheck(Class::forName, "xxx");
-
-