Class LangUtil.AutoClosableCachingSupplier<T extends @Nullable Object>

java.lang.Object
com.dua3.utility.lang.LangUtil.StrongCachingSupplier<T>
com.dua3.utility.lang.LangUtil.AutoClosableCachingSupplier<T>
Type Parameters:
T - the type of the object supplied, which may be nullable
All Implemented Interfaces:
LangUtil.AutoCloseableSupplier<T>, LangUtil.CachingSupplier<T>, AutoCloseable, Supplier<T>
Enclosing class:
LangUtil

public static final class LangUtil.AutoClosableCachingSupplier<T extends @Nullable Object> extends LangUtil.StrongCachingSupplier<T> implements LangUtil.AutoCloseableSupplier<T>
A supplier implementation that extends CachingSupplier and implements the AutoCloseableSupplier interface. This class provides the capability to cache the result of a computation and automatically clean up resources when the cache is reset or the instance is closed.

When the cached value is invalidated, either through reset() or close(), a provided Consumer is invoked to clean up any associated resources.