public interface ExpiringMap<K,V> extends Map<K,V>
| 限定符和类型 | 接口和说明 |
|---|---|
static class |
ExpiringMap.TimeMapEntity<K,V> |
| 限定符和类型 | 字段和说明 |
|---|---|
static Long |
DEFAULT_EXPIRE
默认-1 无超时时间.
|
| 限定符和类型 | 方法和说明 |
|---|---|
Optional<ExpiringMap.TimeMapEntity<K,V>> |
getData(K k)
获取value值
|
Long |
getExpire(K k)
获取某个key的过期时间
|
boolean |
incr(K k,
Long expire,
TimeUnit timeUnit)
增加过期时间
|
void |
init()
初始化
|
ExpiringMap.TimeMapEntity<K,V> |
put(K k,
V v,
Long timeout,
TimeUnit timeUnit)
添加值
|
clear, compute, computeIfAbsent, computeIfPresent, containsKey, containsValue, entrySet, equals, forEach, get, getOrDefault, hashCode, isEmpty, keySet, merge, put, putAll, putIfAbsent, remove, remove, replace, replace, replaceAll, size, valuesstatic final Long DEFAULT_EXPIRE
ExpiringMap.TimeMapEntity<K,V> put(K k, V v, Long timeout, TimeUnit timeUnit)
k - keyv - valuetimeout - 超时时间,timeUnit - 超时时间单位Optional<ExpiringMap.TimeMapEntity<K,V>> getData(K k)
k - keyboolean incr(K k, Long expire, TimeUnit timeUnit)
k - keyexpire - 过期时间timeUnit - 超时时间单位void init()
Copyright © 2022. All rights reserved.