org.ehcache.core.util
Class Functions
java.lang.Object
org.ehcache.core.util.Functions
public class Functions
- extends java.lang.Object
A set of utilities methods and Classes around Functions
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Functions
public Functions()
memoize
public static <A,T> Function<A,T> memoize(Function<A,T> f)
- Will transform the passed in
Function in a apply once and only once Function.
Irrespectively of the argument passed in! And isn't thread safe. Basically acts as a dumb cache.
- Type Parameters:
A - the function's input param typeT - the function's output type- Parameters:
f - the function to memoize
- Returns:
- the memoized function
memoize
public static <A,B,T> BiFunction<A,B,T> memoize(BiFunction<A,B,T> f)
- Will transform the passed in
BiFunction in a apply once and only once BiFunction.
Irrespectively of the arguments passed in! And isn't thread safe. Basically acts as a dumb cache.
- Type Parameters:
A - the bifunction's first input param typeB - the bifunction's second input param typeT - the function's output type- Parameters:
f - the bifunction to memoize
- Returns:
- the memoized bifunction