Class MapBackedCache<K,V>

java.lang.Object
org.apache.solr.common.util.MapBackedCache<K,V>
All Implemented Interfaces:
Cache<K,V>
Direct Known Subclasses:
ObjectCache

public class MapBackedCache<K,V> extends Object implements Cache<K,V>
  • Field Details

    • map

      protected final Map<K,V> map
  • Constructor Details

    • MapBackedCache

      public MapBackedCache(Map<K,V> map)
  • Method Details

    • asMap

      public Map<K,V> asMap()
    • put

      public V put(K key, V val)
      Specified by:
      put in interface Cache<K,V>
    • get

      public V get(K key)
      Specified by:
      get in interface Cache<K,V>
    • remove

      public V remove(K key)
      Specified by:
      remove in interface Cache<K,V>
    • clear

      public void clear()
      Specified by:
      clear in interface Cache<K,V>
    • computeIfAbsent

      public V computeIfAbsent(K key, Function<? super K,? extends V> mappingFunction)
      Specified by:
      computeIfAbsent in interface Cache<K,V>