public class FunctionUtils extends Object
| Modifier and Type | Method and Description |
|---|---|
static <T> java.util.function.Function<T,Void> |
nullFn()
Function which returns
null (type: Void). |
static <A> java.util.function.Consumer<A> |
uncheckedConsumer(ThrowingConsumer<A,?> throwingConsumer)
Converts a
ThrowingConsumer into a Consumer which throws checked exceptions
as unchecked. |
static <A,B> java.util.function.Function<A,B> |
uncheckedFunction(FunctionWithException<A,B,?> functionWithException)
Convert at
FunctionWithException into a Function. |
public static <T> java.util.function.Function<T,Void> nullFn()
null (type: Void).T - input typenull.public static <A,B> java.util.function.Function<A,B> uncheckedFunction(FunctionWithException<A,B,?> functionWithException)
FunctionWithException into a Function.A - input typeB - output typefunctionWithException - function with exception to convert into a functionFunction which throws all checked exception as an unchecked exception.public static <A> java.util.function.Consumer<A> uncheckedConsumer(ThrowingConsumer<A,?> throwingConsumer)
ThrowingConsumer into a Consumer which throws checked exceptions
as unchecked.Copyright © 2014–2018 The Apache Software Foundation. All rights reserved.