Package org.apache.solr.common.util
Class ObjectCache
- java.lang.Object
-
- org.apache.solr.common.util.MapBackedCache<String,Object>
-
- org.apache.solr.common.util.ObjectCache
-
- All Implemented Interfaces:
Closeable,AutoCloseable,SolrCloseable,Cache<String,Object>
public class ObjectCache extends MapBackedCache<String,Object> implements SolrCloseable
Simple object cache with a type-safe accessor.
-
-
Field Summary
-
Fields inherited from class org.apache.solr.common.util.MapBackedCache
map
-
-
Constructor Summary
Constructors Constructor Description ObjectCache()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclear()voidclose()<T> TcomputeIfAbsent(String key, Class<T> clazz, Function<String,? extends T> mappingFunction)Objectget(String key)<T> Tget(String key, Class<T> clazz)booleanisClosed()Objectput(String key, Object val)Objectremove(String key)-
Methods inherited from class org.apache.solr.common.util.MapBackedCache
asMap, computeIfAbsent
-
-
-
-
Method Detail
-
clear
public void clear()
-
computeIfAbsent
public <T> T computeIfAbsent(String key, Class<T> clazz, Function<String,? extends T> mappingFunction)
-
isClosed
public boolean isClosed()
- Specified by:
isClosedin interfaceSolrCloseable
-
close
public void close() throws IOException- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Throws:
IOException
-
-