Class LazySupplier<T>

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

    @ThreadSafe
    public class LazySupplier<T>
    extends java.lang.Object
    implements java.util.function.Supplier<T>
    A supplier of an object that is lazily evaluated (when its value is requested for the first time). It warranties that the real wrapped supplier is called only once.
    Since:
    3.2-ALPHA-13
    Author:
    Fabrizio Giudici
    • Constructor Summary

      Constructors 
      Constructor Description
      LazySupplier()  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void clear()  
      T get()
      void set​(T ref)  
      java.lang.String toString()  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • Constructor Detail

      • LazySupplier

        public LazySupplier()
    • Method Detail

      • get

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

        public void clear()
      • set

        public void set​(@Nonnull
                        T ref)
      • toString

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