Class MemoizedSupplier<T>

  • Type Parameters:
    T - the type of results supplied by this supplier
    All Implemented Interfaces:
    Supplier<T>
    Direct Known Subclasses:
    MemoizedSyncSupplier

    public class MemoizedSupplier<T>
    extends Object
    implements Supplier<T>
    Represents a memoized supplier of a result.

    So same result is returned each time the supplier is invoked.

    This is kind of wrapper of a functional interface implementation whose functional method is get().

    Author:
    silveryocha
    • Constructor Detail

      • MemoizedSupplier

        public MemoizedSupplier​(Supplier<T> supplier)
    • Method Detail

      • get

        public T get()
        Specified by:
        get in interface Supplier<T>
      • clear

        public void clear()