Class LazySupplier<T>

  • All Implemented Interfaces:
    java.util.function.Supplier<T>

    public class LazySupplier<T>
    extends java.lang.Object
    implements java.util.function.Supplier<T>
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private java.util.function.Supplier<T> delegate  
      private T instance  
    • Constructor Summary

      Constructors 
      Constructor Description
      LazySupplier​(java.util.function.Supplier<T> provider)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      T get()  
      T getInstance()  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • delegate

        private java.util.function.Supplier<T> delegate
      • instance

        private volatile T instance
    • Constructor Detail

      • LazySupplier

        public LazySupplier​(java.util.function.Supplier<T> provider)
    • Method Detail

      • get

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

        public T getInstance()