Class Lazy<T>

  • Type Parameters:
    T - The type of the object to be initialized.

    public class Lazy<T>
    extends Object
    A wrapper which lazily-initializes an object using the given supplier.
    • Constructor Detail

      • Lazy

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

      • get

        public T get()
        Gets the inner object. If obj is null, supplier is invoked.
        Returns:
        The inner object.