| Modifier and Type | Field and Description |
|---|---|
protected Function<CacheSrv.Record,Long> |
expireFn |
protected long |
updateTime |
Object |
value |
| Modifier | Constructor and Description |
|---|---|
protected |
Record(Function<CacheSrv.Record,Long> expireFn,
Object value) |
| Modifier and Type | Method and Description |
|---|---|
protected void |
close(String key)
如果缓存值是 AutoCloseable,则在失效时 执行 close
|
long |
getUpdateTime() |
protected long |
left(long timePoint)
相对于某个时间, 还剩多长时间才失效
|
protected boolean |
valid()
是否有效
|
protected final Function<CacheSrv.Record,Long> expireFn
protected long updateTime
public final Object value
protected Record(Function<CacheSrv.Record,Long> expireFn, Object value)
protected boolean valid()
protected long left(long timePoint)
public long getUpdateTime()
protected void close(String key)
key - 缓存keyCopyright © 2022. All rights reserved.