Class Lazy<T>


  • public class Lazy<T>
    extends Object
    Simple utility for building an on-demand (lazy) object-initializer. Works by accepting an initializer describing how to build the on-demand object, which is only called once and only after the first invocation of get() (or it may not be called at all).
    • Constructor Detail

      • Lazy

        public Lazy​(Supplier<T> initializer)
    • Method Detail

      • get

        public T get()
        Returns the instance associated with this Lazy, initializing it if necessary.
      • isInitialized

        public boolean isInitialized()