Package org.elasticsearch.common.util
Class CachedSupplier<T>
- java.lang.Object
-
- org.elasticsearch.common.util.CachedSupplier<T>
-
- All Implemented Interfaces:
java.util.function.Supplier<T>
public final class CachedSupplier<T> extends java.lang.Object implements java.util.function.Supplier<T>
ASupplier
that caches its return value. This may be useful to make aSupplier
idempotent or for performance reasons if always returning the same instance is acceptable.
-
-
Constructor Summary
Constructors Constructor Description CachedSupplier(java.util.function.Supplier<T> supplier)
-