本文整理汇总了Java中com.facebook.internal.CacheableRequestBatch类的典型用法代码示例。如果您正苦于以下问题:Java CacheableRequestBatch类的具体用法?Java CacheableRequestBatch怎么用?Java CacheableRequestBatch使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
CacheableRequestBatch类属于com.facebook.internal包,在下文中一共展示了CacheableRequestBatch类的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: followNextLink
import com.facebook.internal.CacheableRequestBatch; //导入依赖的package包/类
public void followNextLink() {
if (nextRequest != null) {
appendResults = true;
currentRequest = nextRequest;
currentRequest.setCallback(new Request.Callback() {
@Override
public void onCompleted(Response response) {
requestCompleted(response);
}
});
loading = true;
CacheableRequestBatch batch = putRequestIntoBatch(currentRequest, skipRoundtripIfCached);
Request.executeBatchAsync(batch);
}
}
示例2: testCreateEmptyRequestBatch
import com.facebook.internal.CacheableRequestBatch; //导入依赖的package包/类
@SmallTest
@MediumTest
@LargeTest
public void testCreateEmptyRequestBatch() {
CacheableRequestBatch batch = new CacheableRequestBatch();
Request meRequest = Request.newMeRequest(null, null);
assertEquals(0, batch.size());
batch.add(meRequest);
assertEquals(1, batch.size());
assertEquals(meRequest, batch.get(0));
String key = "The Key";
assertNull(batch.getCacheKeyOverride());
batch.setCacheKeyOverride(key);
assertEquals(key, batch.getCacheKeyOverride());
assertTrue(!batch.getForceRoundTrip());
batch.setForceRoundTrip(true);
assertTrue(batch.getForceRoundTrip());
}