Package com.xxl.tool.cache.model
Class CacheObject<K,V>
java.lang.Object
com.xxl.tool.cache.model.CacheObject<K,V>
- All Implemented Interfaces:
Serializable
Cache Object
- See Also:
-
Constructor Details
-
CacheObject
构造- Parameters:
key- 键value- 值ttl- 超时时长expireType- 过期策略,true 表示 expireAfterAccess,false 表示 expireAfterWrite
-
-
Method Details
-
getKey
-
getValue
-
getTtl
public long getTtl() -
getExpiredTime
获取过期时间,返回null表示永不过期 -
getLastAccess
public long getLastAccess()获取上次访问时间 -
toString
-
isExpired
public boolean isExpired()判断是否过期 -
get
获取值- Parameters:
isUpdateLastAccess- 是否更新最后访问时间- Returns:
- 获得对象
-
getAccessCount
获取访问次数
-