本文整理匯總了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;