类 UncheckedFunctions
- java.lang.Object
-
- net.dongliu.commons.function.UncheckedFunctions
-
public class UncheckedFunctions extends java.lang.ObjectWrap checked interface to unchecked interface.If exception occurred, unchecked exceptions will be thrown directly,
IOExceptionwill be wrapped inUncheckedIOException, other checked exceptions will be wrapped inUndeclaredLambdaException
-
-
嵌套类概要
嵌套类 修饰符和类型 类 说明 static interfaceUncheckedFunctions.EBiConsumer<T,U>static interfaceUncheckedFunctions.EBiFunction<T,U,R>static interfaceUncheckedFunctions.EConsumer<T>static interfaceUncheckedFunctions.EFunction<T,R>static interfaceUncheckedFunctions.EPredicate<T>static interfaceUncheckedFunctions.ERunnablestatic interfaceUncheckedFunctions.ESupplier<T>
-
方法概要
所有方法 静态方法 具体方法 修饰符和类型 方法 说明 static <T,U>
java.util.function.BiConsumer<T,U>biConsumer(UncheckedFunctions.EBiConsumer<T,U> consumer)Wrap to BiConsumer interfacestatic <T,U,R>
java.util.function.BiFunction<T,U,R>biFunction(UncheckedFunctions.EBiFunction<T,U,R> function)Wrap to BiFunction interfacestatic <T> Tcall(UncheckedFunctions.ESupplier<T> supplier)Call a block of code, return resultstatic <T> java.util.function.Consumer<T>consumer(UncheckedFunctions.EConsumer<T> consumer)Wrap to Consumer interfacestatic <T,R>
java.util.function.Function<T,R>function(UncheckedFunctions.EFunction<T,R> function)Wrap to Function interfacestatic <T> java.util.function.Predicate<T>predicate(UncheckedFunctions.EPredicate<T> predicate)Wrap to Predicate interfacestatic voidrun(UncheckedFunctions.ERunnable runnable)Run a block of codestatic java.lang.Runnablerunnable(UncheckedFunctions.ERunnable runnable)Wrap to Runnable interfacestatic <T> java.util.function.Supplier<T>supplier(UncheckedFunctions.ESupplier<T> supplier)Wrap to Supplier interface
-
-
-
方法详细资料
-
run
public static void run(UncheckedFunctions.ERunnable runnable)
Run a block of code- 参数:
runnable- the code to run
-
call
public static <T> T call(UncheckedFunctions.ESupplier<T> supplier)
Call a block of code, return result- 参数:
supplier- the code to run
-
runnable
public static java.lang.Runnable runnable(UncheckedFunctions.ERunnable runnable)
Wrap to Runnable interface- 返回:
- wrapped runnable
-
supplier
public static <T> java.util.function.Supplier<T> supplier(UncheckedFunctions.ESupplier<T> supplier)
Wrap to Supplier interface- 返回:
- the Supplier
-
consumer
public static <T> java.util.function.Consumer<T> consumer(UncheckedFunctions.EConsumer<T> consumer)
Wrap to Consumer interface- 返回:
- the Consumer
-
predicate
public static <T> java.util.function.Predicate<T> predicate(UncheckedFunctions.EPredicate<T> predicate)
Wrap to Predicate interface- 类型参数:
T- type to test- 返回:
- Predicate
-
function
public static <T,R> java.util.function.Function<T,R> function(UncheckedFunctions.EFunction<T,R> function)
Wrap to Function interface- 类型参数:
T- function param typeR- function return type- 返回:
- the Function
-
biConsumer
public static <T,U> java.util.function.BiConsumer<T,U> biConsumer(UncheckedFunctions.EBiConsumer<T,U> consumer)
Wrap to BiConsumer interface- 返回:
- the BiConsumer
-
biFunction
public static <T,U,R> java.util.function.BiFunction<T,U,R> biFunction(UncheckedFunctions.EBiFunction<T,U,R> function)
Wrap to BiFunction interface- 类型参数:
T- first function param typeU- second function param typeR- function return type- 返回:
- the BiFunction
-
-