Back to project page cube-sdk.
The source code is released under:
Apache License
If you think the Android project cube-sdk listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.
package in.srain.cube.cache; /*www . j a va 2s .c o m*/ import in.srain.cube.request.JsonData; /** * Describe the behaviour of a object who can be cached */ public interface ICacheAble<T> { /** * In seconds * * @return */ public long getCacheTime(); public String getCacheKey(); /** * file path under /res, For example: "/cache_init/test.json"; */ public String getAssertInitDataPath(); /** * We need to process the data from data source, do some filter of convert the structure. * <p/> * As the "Assert Data" is a special data source, we also need to do the same work. */ public T processRawDataFromCache(JsonData rawData); /** * when data loaded from cache * * @param cacheData * @param outOfDate */ public void onCacheData(CacheResultType cacheResultType, T cacheData, boolean outOfDate); /** * create data when no cache is available. */ public void createDataForCache(CacheManager cacheManager); /** * temporarily disable cache. The data will no be load from cache and will also not put into cache * * @return */ public boolean cacheIsDisabled(); }