K
- the key type. This must have both Object.equals(Object)
and Object.hashCode()
correctly implemented.V
- the value type. It is generally recommended to use an immutable
type here, but this is not required.public interface ICacheBackend<K,V>
Implementations are not required to deal with synchronization. This has to be handled by the caller.
Modifier and Type | Method and Description |
---|---|
ICacheBackend<K,V> |
newInstance()
Returns a new instance of this backend.
|
V |
retrieve(K key)
Returns the value stored at a given key or null.
|
void |
store(K key,
V value)
Stores an element (value) using the given key.
|
V retrieve(K key)
store(Object, Object)
can be
returned. However, there is no guarantee that a non-null value is
returned, i.e. the cache may forget information.ICacheBackend<K,V> newInstance()