com.twitter.common.util.caching
Interface Cache<K,V>

All Known Implementing Classes:
LRUCache

public interface Cache<K,V>

Definition of basic caching functionality. Cache keys and values are expected to always be valid, non-null values.


Method Summary
 void delete(K key)
          Deletes an entry from the cache.
 V get(K key)
          Fetches a value from the cache.
 void put(K key, V value)
          Stores a key-value pair in the cache.
 

Method Detail

get

V get(K key)
Fetches a value from the cache.

Parameters:
key - The key for the value to fetch, must not be null.
Returns:
The cached value corresponding with key, or null if no entry exists.

put

void put(K key,
         V value)
Stores a key-value pair in the cache.

Parameters:
key - The key to store, must not be null.
value - The value to store, must not be null.

delete

void delete(K key)
Deletes an entry from the cache.

Parameters:
key - Key for the value to delete, must not be null.