Class ObjectCache<T>
java.lang.Object
io.nosqlbench.engine.api.templating.ObjectCache<T>
- Type Parameters:
T- The type of object.
- All Implemented Interfaces:
java.util.function.Function<java.lang.String,T>
public class ObjectCache<T>
extends java.lang.Object
implements java.util.function.Function<java.lang.String,T>
An object cache to memoize returned objects into a concurrent hash map by name.
This is meant to be used when you want to lazily initialize an instance of something
by name that is likely to be re-used over the lifetime of an owning object.
-
Constructor Summary
Constructors Constructor Description ObjectCache(java.util.function.Function<java.lang.String,T> newInstanceFunction) -
Method Summary
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface java.util.function.Function
andThen, compose
-
Constructor Details
-
ObjectCache
-
-
Method Details
-
apply
- Specified by:
applyin interfacejava.util.function.Function<java.lang.String,T>
-