本文整理汇总了Java中com.box.androidsdk.content.requests.BoxCacheableRequest类的典型用法代码示例。如果您正苦于以下问题:Java BoxCacheableRequest类的具体用法?Java BoxCacheableRequest怎么用?Java BoxCacheableRequest使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
BoxCacheableRequest类属于com.box.androidsdk.content.requests包,在下文中一共展示了BoxCacheableRequest类的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: execute
import com.box.androidsdk.content.requests.BoxCacheableRequest; //导入依赖的package包/类
@Override
public void execute(BoxRequest request) {
if (request == null) {
return;
}
if (BoxConfig.getCache() != null && request instanceof BoxCacheableRequest){
try {
BoxFutureTask cacheTask = ((BoxCacheableRequest) request).toTaskForCachedResult();
if (mListener != null){
cacheTask.addOnCompletedListener(mListener);
}
getApiExecutor().execute(cacheTask);
} catch (BoxException e){
BoxLogUtils.e("cache task error ", e);
}
}
BoxFutureTask task = request.toTask();
if (mListener != null) {
task.addOnCompletedListener(mListener);
}
// Thumbnail request should be executed in their own executor pool
ThreadPoolExecutor executor = request instanceof BoxRequestsFile.DownloadThumbnail ?
getThumbnailExecutor() :
getApiExecutor();
executor.submit(task);
}
示例2: get
import com.box.androidsdk.content.requests.BoxCacheableRequest; //导入依赖的package包/类
@Override
public <T extends BoxObject, R extends BoxRequest & BoxCacheableRequest> T get(R request) throws BoxException {
if (request instanceof BoxRequestsFolder.GetFolderWithAllItems){
// Assume fields have not changed.
return (T)mFullFolderCache.get(((BoxRequestsFolder.GetFolderWithAllItems) request).getId());
}
return null;
}
示例3: get
import com.box.androidsdk.content.requests.BoxCacheableRequest; //导入依赖的package包/类
/**
* Returns the last cached BoxObject for this BoxRequest.
* @param request - The BoxRequest object that can be used for fetching remote data.
* @param <T> A child of BoxObject
* @param <R> A child of BoxRequest that implements BoxCacheableRequest
* @return a BoxObject associated with the request type.
* @throws BoxException thrown if the request fails.
*/
<T extends BoxObject, R extends BoxRequest & BoxCacheableRequest> T get(R request) throws BoxException;