Class LazySupplier<T>

java.lang.Object
it.tidalwave.util.LazySupplier<T>
All Implemented Interfaces:
Supplier<T>

@ThreadSafe public class LazySupplier<T> extends Object implements 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 Details

    • LazySupplier

      public LazySupplier()
  • Method Details

    • get

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

      public void clear()
    • set

      public void set(@Nonnull T ref)
    • toString

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