org.apache.solr.common.util

## Class MapBackedCache<K,V>

- java.lang.Object
- - org.apache.solr.common.util.MapBackedCache<K,V>

- All Implemented Interfaces:
    Cache<K,V>

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

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `MapBackedCache(Map<K,V> map)`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `clear()`
    `V` | `computeIfAbsent(K key, Function<? super K,? extends V> mappingFunction)`
    `V` | `get(K key)`
    `V` | `put(K key, V val)`
    `V` | `remove(K key)`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### MapBackedCache

          public MapBackedCache(Map<K,V> map)

  - ### Method Detail

    - #### 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>`

Copyright © 2000-2016 Apache Software Foundation. All Rights Reserved.