Class Suppliers
- java.lang.Object
-
- org.apache.jackrabbit.oak.commons.internal.function.Suppliers
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static <T> Supplier<T>memoize(Supplier<T> computeOnce)Transforms aSupplierbased on a wrapper that evaluates the givenSupplierat most one time.
-
-
-
Method Detail
-
memoize
public static <T> Supplier<T> memoize(Supplier<T> computeOnce)
Transforms aSupplierbased on a wrapper that evaluates the givenSupplierat most one time.Suppliers returning
nullvalues are allowed; the memoized Supplier will be returnnullwhen the wrapped one does on first invocation.- Type Parameters:
T- return type- Returns:
- Supplier based on the given Supplier
-
-