K - Key类型V - Value类型public class CacheObj<K extends Serializable,V extends Serializable> extends Object implements Serializable
| 限定符和类型 | 字段和说明 |
|---|---|
protected LongAdder |
accessCount
访问次数
|
protected K |
key |
protected long |
lastAccess
上次访问时间
|
protected V |
obj |
protected long |
ttl
对象存活时长,0表示永久存活
|
protected final K extends Serializable key
protected final V extends Serializable obj
protected volatile long lastAccess
protected final LongAdder accessCount
protected final long ttl
public K getKey()
public V getValue()
public long getTtl()
public Date getExpiredTime()
null表示永不过期null表示永不过期public long getLastAccess()
protected boolean isExpired()
protected V get(boolean isUpdateLastAccess)
isUpdateLastAccess - 是否更新最后访问时间Copyright © 2023. All rights reserved.