public interface ICacheAble<T>
| Modifier and Type | Method and Description |
|---|---|
boolean |
cacheIsDisabled()
check if cache is disabled
|
java.lang.String |
getAssertInitDataPath() |
java.lang.String |
getCacheKey() |
long |
getCacheTime()
In seconds
|
void |
onCacheData(CacheResultType cacheResultType,
T cacheData,
boolean outOfDate)
when data loaded from cache
|
void |
onNoCacheData(CacheManager cacheManager)
When there is no cache data is available, this method will be called.
|
T |
processRawDataFromCache(JsonData rawData)
We need to process the data from data source, do some filter of convert the structure.
|
ICacheAble<T> |
setAssertInitDataPath(java.lang.String path) |
ICacheAble<T> |
setCacheKey(java.lang.String key) |
ICacheAble<T> |
setCacheTime(long time)
set cache time, in seconds
|
ICacheAble<T> |
setDisableCache(boolean disable)
temporarily disable cache.
|
ICacheAble<T> |
setUseCacheAnyway(boolean use)
Using cache data if existent, ignore whether it is expired or not.
|
boolean |
useCacheAnyway()
check if use cache anyway
|
ICacheAble<T> setCacheTime(long time)
time - long getCacheTime()
ICacheAble<T> setCacheKey(java.lang.String key)
java.lang.String getCacheKey()
ICacheAble<T> setUseCacheAnyway(boolean use)
use - boolean useCacheAnyway()
ICacheAble<T> setAssertInitDataPath(java.lang.String path)
path - file path under /res, For example: "/cache_init/test.json";java.lang.String getAssertInitDataPath()
T processRawDataFromCache(JsonData rawData)
void onCacheData(CacheResultType cacheResultType, T cacheData, boolean outOfDate)
cacheData - outOfDate - void onNoCacheData(CacheManager cacheManager)
ICacheAble<T> setDisableCache(boolean disable)
boolean cacheIsDisabled()