Class Functions

    • Method Detail

      • singleton

        public static <T> Supplier<T> singleton​(Supplier<T> generator)
        Creates a supplier which loads the value at most once with the provided generator.
        Type Parameters:
        T - the type of result
        Parameters:
        generator - the generator to load the value
        Returns:
        a singleton supplier