Interface ClearableLazy<T>

All Superinterfaces:
Lazy<T>, Supplier<T>
All Known Implementing Classes:
ClearableLazy.Concurrent, ClearableLazy.Fast

public interface ClearableLazy<T> extends Lazy<T>
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Interface
    Description
    static final class 
    Thread-safe implementation.
    static final class 
    Non-thread-safe implementation.
  • Method Summary

    Modifier and Type
    Method
    Description
    static <T> ClearableLazy<T>
    concurrentOf(@NotNull Supplier<T> supplier)
    Constructs a thread-safe lazy-initialized object
    void
     
    static <T> ClearableLazy<T>
    of(@NotNull Supplier<T> supplier)
    Constructs a lazy-initialized object

    Methods inherited from interface java.util.function.Supplier

    get
  • Method Details

    • invalidate

      void invalidate()
    • of

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