Class LazyCachingSupplier<T>

java.lang.Object
io.deephaven.util.datastructures.LazyCachingSupplier<T>
All Implemented Interfaces:
Supplier<T>

public final class LazyCachingSupplier<T>
extends Object
implements Supplier<T>
Supplier wrapper that caches the result in a SoftReference. Only suitable to wrap suppliers that are safely repeatable and don't return null.
  • Constructor Details

    • LazyCachingSupplier

      public LazyCachingSupplier​(@NotNull Supplier<T> internalSupplier)
      Construct a Supplier wrapper.
      Parameters:
      internalSupplier - The Supplier to wrap. Must be safely repeatable and must not return null.
  • Method Details