当前位置: 首页>>代码示例>>Java>>正文


Java CacheableRequestBatch类代码示例

本文整理汇总了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);
    }
}
 
开发者ID:MobileDev418,项目名称:AndroidBackendlessChat,代码行数:18,代码来源:GraphObjectPagingLoader.java

示例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());
}
 
开发者ID:kodamirmo,项目名称:LostAndFound,代码行数:22,代码来源:BatchRequestTests.java


注:本文中的com.facebook.internal.CacheableRequestBatch类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。