Class Suppliers


  • public class Suppliers
    extends Object
    Utility methods for Supplier handling.
    • Method Detail

      • memoize

        public static <T> Supplier<T> memoize​(Supplier<T> computeOnce)
        Transforms a Supplier based on a wrapper that evaluates the given Supplier at most one time.

        Suppliers returning null values are allowed; the memoized Supplier will be return null when the wrapped one does on first invocation.

        Type Parameters:
        T - return type
        Returns:
        Supplier based on the given Supplier