类 AbstractCacheService
java.lang.Object
cn.zhxu.toys.cache.AbstractCacheService
- 所有已实现的接口:
CacheService
- 从以下版本开始:
- v0.4.9
- 作者:
- Troy.Zhou
-
字段概要
从接口继承的字段 cn.zhxu.toys.cache.CacheService
LONG_CACHE_SECONDS, MEDIUM_CACHE_SECONDS, NULL, SHORT_CACHE_SECONDS -
构造器概要
构造器 -
方法概要
修饰符和类型方法说明<T> Tcache(String key, int timeoutSeconds, cn.zhxu.data.TypeRef<T> resType, CacheGetter<T> getter) 先读,读不到则写<T> Tcache(String key, int timeoutSeconds, Class<T> resType, CacheGetter<T> getter) 先读,读不到则写<T> T只读<T> T只读<T> TcacheBean(String key, int timeoutSeconds, Class<T> resType, CacheGetter<T> getter) 先读,读不到则写<T> List<T>cacheList(String key, int timeoutSeconds, Class<T> resType, CacheGetter<List<T>> getter) 先读,读不到则写<T> TcacheLong(String key, cn.zhxu.data.TypeRef<T> resType, CacheGetter<T> getter) 先读,读不到则写<T> TcacheLong(String key, Class<T> resType, CacheGetter<T> getter) 先读,读不到则写void只写<T> TcacheMedium(String key, cn.zhxu.data.TypeRef<T> resType, CacheGetter<T> getter) 先读,读不到则写<T> TcacheMedium(String key, Class<T> resType, CacheGetter<T> getter) 先读,读不到则写voidcacheMedium(String key, Object object) 只写<T> TcacheShort(String key, cn.zhxu.data.TypeRef<T> resType, CacheGetter<T> getter) 先读,读不到则写<T> TcacheShort(String key, Class<T> resType, CacheGetter<T> getter) 先读,读不到则写voidcacheShort(String key, Object object) 只写protected abstract <T> TdoCache(String key, int timeoutSeconds, Type resType, CacheGetter<T> getter) 先读,都读到则返回,否则若 getter 非空,则写protected abstract <T> List<T>doCacheList(String key, int timeoutSeconds, Class<T> resType, CacheGetter<List<T>> getter) 先读,都读到则返回,否则若 getter 非空,则写booleanvoidsetNotConvertStrToJson(boolean notConvertStrToJson) protected <T> Tprotected <T> List<T>protected String从类继承的方法 java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait从接口继承的方法 cn.zhxu.toys.cache.CacheService
cache, delete
-
构造器详细资料
-
AbstractCacheService
public AbstractCacheService()
-
-
方法详细资料
-
cache
从接口复制的说明:CacheService只读- 指定者:
cache在接口中CacheService- 类型参数:
T- 泛型- 参数:
key- 键resType- 类型
-
cache
从接口复制的说明:CacheService只读- 指定者:
cache在接口中CacheService- 类型参数:
T- 泛型- 参数:
key- 键resType- 类型
-
cacheShort
从接口复制的说明:CacheService先读,读不到则写- 指定者:
cacheShort在接口中CacheService- 类型参数:
T- 泛型- 参数:
key- 键resType- 类型getter- CacheGetter
-
cacheShort
从接口复制的说明:CacheService先读,读不到则写- 指定者:
cacheShort在接口中CacheService- 类型参数:
T- 泛型- 参数:
key- 键resType- 类型getter- CacheGetter
-
cacheMedium
从接口复制的说明:CacheService先读,读不到则写- 指定者:
cacheMedium在接口中CacheService- 类型参数:
T- 泛型- 参数:
key- 键resType- 类型getter- CacheGetter
-
cacheMedium
从接口复制的说明:CacheService先读,读不到则写- 指定者:
cacheMedium在接口中CacheService- 类型参数:
T- 泛型- 参数:
key- 键resType- 类型getter- CacheGetter
-
cacheLong
从接口复制的说明:CacheService先读,读不到则写- 指定者:
cacheLong在接口中CacheService- 类型参数:
T- 泛型- 参数:
key- 键resType- 类型getter- CacheGetter
-
cacheLong
从接口复制的说明:CacheService先读,读不到则写- 指定者:
cacheLong在接口中CacheService- 类型参数:
T- 泛型- 参数:
key- 键resType- 类型getter- CacheGetter
-
cacheShort
从接口复制的说明:CacheService只写- 指定者:
cacheShort在接口中CacheService- 参数:
key- 键object- 对象
-
cacheMedium
从接口复制的说明:CacheService只写- 指定者:
cacheMedium在接口中CacheService- 参数:
key- 键object- 对象
-
cacheLong
从接口复制的说明:CacheService只写- 指定者:
cacheLong在接口中CacheService- 参数:
key- 键object- 对象
-
cache
从接口复制的说明:CacheService先读,读不到则写- 指定者:
cache在接口中CacheService- 类型参数:
T- 泛型- 参数:
key- 键timeoutSeconds- 过期秒数resType- 类型getter- CacheGetter
-
cache
public <T> T cache(String key, int timeoutSeconds, cn.zhxu.data.TypeRef<T> resType, CacheGetter<T> getter) 从接口复制的说明:CacheService先读,读不到则写- 指定者:
cache在接口中CacheService- 类型参数:
T- 泛型- 参数:
key- 键timeoutSeconds- 过期秒数resType- 类型getter- CacheGetter
-
cacheBean
从接口复制的说明:CacheService先读,读不到则写- 指定者:
cacheBean在接口中CacheService- 类型参数:
T- 泛型- 参数:
key- 键timeoutSeconds- 过期秒数resType- 类型getter- CacheGetter
-
cacheList
public <T> List<T> cacheList(String key, int timeoutSeconds, Class<T> resType, CacheGetter<List<T>> getter) 从接口复制的说明:CacheService先读,读不到则写- 指定者:
cacheList在接口中CacheService- 类型参数:
T- 泛型- 参数:
key- 键timeoutSeconds- 过期秒数resType- 类型getter- CacheGetter
-
doCache
protected abstract <T> T doCache(String key, int timeoutSeconds, Type resType, CacheGetter<T> getter) 先读,都读到则返回,否则若 getter 非空,则写- 类型参数:
T- 泛型- 参数:
key- 缓存键timeoutSeconds- 过期秒数resType- 返回类型getter- 获取器- 返回:
- 缓存值
-
doCacheList
protected abstract <T> List<T> doCacheList(String key, int timeoutSeconds, Class<T> resType, CacheGetter<List<T>> getter) 先读,都读到则返回,否则若 getter 非空,则写- 类型参数:
T- 泛型- 参数:
key- 缓存键timeoutSeconds- 过期秒数resType- 返回类型getter- 获取器- 返回:
- 缓存值
-
toBean
-
toList
-
toString
-
isNotConvertStrToJson
public boolean isNotConvertStrToJson()- 返回:
- 是否不将字符串转换为 JSON
-
setNotConvertStrToJson
public void setNotConvertStrToJson(boolean notConvertStrToJson)
-