接口 NonNullLazy<T>

类型参数:
T - The type of the value
所有超级接口:
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.
  • 方法详细资料

    • of

      static <T> NonNullLazy<T> of(@NotNull @NotNull NonNullSupplier<T> supplier)
      Constructs a lazy-initialized object
      参数:
      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
      参数:
      supplier - The supplier for the value, to be called the first time the value is needed.