Class Lazy<T>

  • Type Parameters:
    T - The type that will be created and supplied
    All Implemented Interfaces:
    java.util.function.Supplier<T>

    public class Lazy<T>
    extends java.lang.Object
    implements java.util.function.Supplier<T>
    NOT THREAD SAFE - intended to be used in single request scope
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      T get()  
      static <V,​A>
      Lazy<V>
      lazy​(A argument, java.util.function.Function<A,​V> initializer)  
      static <V,​A>
      Lazy<V>
      lazy​(java.util.function.Supplier<A> argument, java.util.function.Function<A,​V> initializer)  
      static <V> Lazy<V> lazy​(java.util.function.Supplier<V> supplier)  
      • Methods inherited from class java.lang.Object

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

      • lazy

        public static <V> Lazy<V> lazy​(java.util.function.Supplier<V> supplier)
      • lazy

        public static <V,​A> Lazy<V> lazy​(A argument,
                                               java.util.function.Function<A,​V> initializer)
      • lazy

        public static <V,​A> Lazy<V> lazy​(java.util.function.Supplier<A> argument,
                                               java.util.function.Function<A,​V> initializer)
      • get

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