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 void
clear()
void
close()
<T> T
computeIfAbsent(String key, Class<T> clazz, Function<String,? extends T> mappingFunction)
Object
get(String key)
<T> T
get(String key, Class<T> clazz)
boolean
isClosed()
Object
put(String key, Object val)
Object
remove(String key)
-
Methods inherited from class org.apache.solr.common.util.MapBackedCache
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:
isClosed
in interfaceSolrCloseable
-
close
public void close() throws IOException
- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceCloseable
- Throws:
IOException
-
-