Class SoftCachingSupplier<OUTPUT_TYPE>

java.lang.Object
io.deephaven.util.datastructures.SoftCachingSupplier<OUTPUT_TYPE>
Type Parameters:
OUTPUT_TYPE - the type of results supplied by this supplier
All Implemented Interfaces:
Supplier<OUTPUT_TYPE>

public final class SoftCachingSupplier<OUTPUT_TYPE> extends Object implements Supplier<OUTPUT_TYPE>
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

    • SoftCachingSupplier

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