public interface Cache<K,V>
| 限定符和类型 | 方法和说明 |
|---|---|
void |
clean() |
V |
get(K key)
get by key
|
V |
get(K key,
Supplier<K,V> loader) |
Map<K,V> |
getAll(Iterable<K> keys)
multiple get
|
Map<K,V> |
getAllIfPresent(Iterable<K> keys)
multiple get
|
V |
getIfPresent(K key) |
void |
refresh(K key) |
List<V> |
remove(Collection<K> keys) |
V |
remove(K key) |
void |
set(K key,
V value)
set a key-value to cache, with out expire time never
|
void |
set(K key,
V value,
long expireTime)
set a key-value to cache, with the specified expire time
|
void |
set(K key,
V value,
long ttl,
TimeUnit timeUnit)
set a key-value to cache, with the specified expire time
|
int |
size() |
Map<K,V> |
toMap() |
void set(@NonNull K key, @Nullable V value)
key - the keyvalue - the valuevoid set(@NonNull K key, @Nullable V value, long expireTime)
key - the keyvalue - the valueexpireTime - the expire timevoid set(@NonNull K key, @Nullable V value, long ttl, TimeUnit timeUnit)
key - the keyvalue - the valuettl - the time-to-live time, the live timeMap<K,V> getAll(@NonNull Iterable<K> keys)
keys - get the specified keysMap<K,V> getAllIfPresent(@NonNull Iterable<K> keys)
keys - get the specified keysList<V> remove(Collection<K> keys)
void clean()
int size()
Copyright © 2021. All rights reserved.