Interface NonNullLazy<T>

Type Parameters:
T - The type of the value
All Superinterfaces:
NonNullSupplier<T>

public interface NonNullLazy<T> extends NonNullSupplier<T>
Proxy object for a value that is calculated on first access. Same as Lazy, but with a nonnull contract.
  • Method Details

    • of

      static <T> NonNullLazy<T> of(@NotNull @NotNull NonNullSupplier<T> supplier)
      Constructs a lazy-initialized object
      Parameters:
      supplier - The supplier for the value, to be called the first time the value is needed.
    • concurrentOf

      static <T> NonNullLazy<T> concurrentOf(@NotNull @NotNull NonNullSupplier<T> supplier)
      Constructs a thread-safe lazy-initialized object
      Parameters:
      supplier - The supplier for the value, to be called the first time the value is needed.