Class MemoizingSupplier<T>

  • Type Parameters:
    T - the supplier type
    All Implemented Interfaces:
    java.io.Serializable, java.util.function.Supplier<T>

    public class MemoizingSupplier<T>
    extends java.lang.Object
    implements java.util.function.Supplier<T>, java.io.Serializable
    Returns a supplier which caches the instance retrieved during the first call to get() and returns that value on subsequent calls to get().
    See Also:
    Serialized Form
    • Constructor Summary

      Constructors 
      Constructor Description
      MemoizingSupplier​(java.util.function.Supplier<T> delegate)  
    • Constructor Detail

      • MemoizingSupplier

        public MemoizingSupplier​(@Nonnull
                                 java.util.function.Supplier<T> delegate)
    • Method Detail

      • get

        public T get()
        Specified by:
        get in interface java.util.function.Supplier<T>
      • isInitialized

        public boolean isInitialized()
      • reset

        public void reset()
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object