public interface Cache<K,V>
| 限定符和类型 | 方法和说明 |
|---|---|
void |
clear()
Clear the entire cache.
|
V |
get(K key)
Take the corresponding value from the cache according to the cache key.
|
V |
get(K key,
Callable<? extends V> call)
Get the value in the cache according to the primary key, and put it into the cache after processing by the function.
|
int |
getSize()
Returns the number of key-value pairs in the cache.
|
void |
put(K key,
V val)
Cache a pair of key value.
|
V |
remove(K key)
Take the corresponding value from the cache according to the cache key, and remove this record from the cache.
|
void put(K key, V val)
key - cache keyval - cache valueV get(K key)
key - cache keyV get(K key, Callable<? extends V> call) throws Exception
key - cache keycall - a function, the return value of the function will be updated to the cacheException - callable function interface throw exceptionV remove(K key)
key - cache keyvoid clear()
int getSize()
Copyright © 2018–2024 Alibaba Group. All rights reserved.