Package top.tangyh.basic.cache.redis2
Class CacheResult<T>
java.lang.Object
top.tangyh.basic.cache.redis2.CacheResult<T>
- Type Parameters:
T- 实际值
缓存返回对象
- Version:
- v1.0
- Author:
- tangyh
-
Constructor Summary
ConstructorsConstructorDescriptionCacheResult(String key) CacheResult(String key, Duration expire, T rawValue) CacheResult(String key, T rawValue) CacheResult(CacheHashKey cacheKey, T rawValue) CacheResult(CacheKey cacheKey) CacheResult(CacheKey cacheKey, T rawValue) -
Method Summary
-
Constructor Details
-
CacheResult
-
CacheResult
-
CacheResult
-
CacheResult
-
CacheResult
-
CacheResult
-
-
Method Details
-
getValue
缓存对象- Returns:
- cache object include null object
-
isNullVal
public boolean isNullVal()是否缓存的空值- Returns:
- 返回true 表示redis缓存了空值, 一般情况下数据库没有值才会缓存空值
-
isNull
public boolean isNull()是否没有缓存- Returns:
- 返回true 表示redis没有该值, 并不能确定数据库有无该值!
-
asList
-
asString
-
asLong
-
asLong
public long asLong(long defValue) -
toString
-