接口 Lazy<T>

类型参数:
T - The type of the value
所有超级接口:
Supplier<T>
所有已知子接口:
ClearableLazy<T>
所有已知实现类:
ClearableLazy.Concurrent, ClearableLazy.Fast, Lazy.Concurrent, Lazy.Fast

public interface Lazy<T> extends Supplier<T>
Proxy object for a value that is calculated on first access
  • 嵌套类概要

    嵌套类
    修饰符和类型
    接口
    说明
    static final class 
    Thread-safe implementation.
    static final class 
    Non-thread-safe implementation.
  • 方法概要

    静态方法
    修饰符和类型
    方法
    说明
    static <T> Lazy<T>
    concurrentOf(@NotNull Supplier<T> supplier)
    Constructs a thread-safe lazy-initialized object
    static <T> Lazy<T>
    of(@NotNull Supplier<T> supplier)
    Constructs a lazy-initialized object

    从接口继承的方法 java.util.function.Supplier

    get
  • 方法详细资料

    • of

      static <T> Lazy<T> of(@NotNull @NotNull Supplier<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> Lazy<T> concurrentOf(@NotNull @NotNull Supplier<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.