Interface Cache<K,V>
- All Known Implementing Classes:
CaffeineCache
public interface Cache<K,V>
A mapping from key to values.
It allows binding CachingVersionedLayers
to various cache providers.
-
Method Summary
Modifier and TypeMethodDescriptionlong
Returns the estimated size provided by the underlying cache, -1 if not available.long
Returns the estimated weight provided by the underlying cache, -1 if not available.long
Returns the eviction count provided by the underlying cache, -1 if not available.long
Returns the eviction weight provided by the underlying cache, -1 if not available.Returns the value associated to a key.Returns the values associated to the keys.void
Associates a value with the provided key.
-
Method Details
-
estimatedSize
long estimatedSize()Returns the estimated size provided by the underlying cache, -1 if not available. -
estimatedWeight
long estimatedWeight()Returns the estimated weight provided by the underlying cache, -1 if not available. -
evictionCount
long evictionCount()Returns the eviction count provided by the underlying cache, -1 if not available. -
evictionWeight
long evictionWeight()Returns the eviction weight provided by the underlying cache, -1 if not available. -
get
Returns the value associated to a key.It returns null if the key is not present in the cache.
-
getAll
Returns the values associated to the keys.It returns only the entries that are already present in the cache.
-
put
Associates a value with the provided key.If the key is already present, it updates the value.
-