类 Functions
- java.lang.Object
-
- net.dongliu.commons.function.Functions
-
public class Functions extends java.lang.ObjectUtils for Function
-
-
方法详细资料
-
memoize
public static <T,R> java.util.function.Function<T,R> memoize(java.util.function.Function<T,R> function)
Return a thread-safe Function which only calculate once for each key.The passed in function should not return null value, or throw exception. If error occurred when compute value, the exception would be thrown, and the next call will run the code again. If computed value is null, a NPE would be thrown.
-
-