本文整理汇总了Java中org.jboss.aerogear.android.pipe.module.PipeModule类的典型用法代码示例。如果您正苦于以下问题:Java PipeModule类的具体用法?Java PipeModule怎么用?Java PipeModule使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
PipeModule类属于org.jboss.aerogear.android.pipe.module包,在下文中一共展示了PipeModule类的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getModules
import org.jboss.aerogear.android.pipe.module.PipeModule; //导入依赖的package包/类
@Override
public List<PipeModule> getModules() {
return new ArrayList<PipeModule>(this.modules);
}
示例2: runReadWithFilter
import org.jboss.aerogear.android.pipe.module.PipeModule; //导入依赖的package包/类
public void runReadWithFilter() throws Exception {
final CountDownLatch latch = new CountDownLatch(1);
HttpProviderFactory factory = mock(HttpProviderFactory.class);
when(factory.get(anyObject())).thenReturn(mock(HttpProvider.class));
ModuleFields authFields = new ModuleFields();
PipeModule urlModule = mock(PipeModule.class);
when(urlModule.loadModule((URI) anyObject(), (String) anyObject(), (byte[]) anyObject())).thenReturn(authFields);
RestfulPipeConfiguration config = PipeManager.config("listClassId", RestfulPipeConfiguration.class).withUrl(url);
config.module(urlModule);
RestAdapter<Data> adapter = new RestAdapter<Data>(Data.class, url, config);
Object restRunner = UnitTestUtils.getPrivateField(adapter, "restRunner");
UnitTestUtils.setPrivateField(restRunner, "httpProviderFactory", factory);
ReadFilter filter = new ReadFilter();
filter.setLimit(10);
filter.setWhere(new JSONObject("{\"model\":\"BMW\"}"));
adapter.read(filter, new Callback<List<Data>>() {
@Override
public void onSuccess(List<Data> data) {
latch.countDown();
}
@Override
public void onFailure(Exception e) {
latch.countDown();
Logger.getLogger(getClass().getSimpleName()).log(Level.SEVERE, TAG, e);
}
});
latch.await(500, TimeUnit.MILLISECONDS);
verify(factory).get(new URL(url.toString() + "?limit=10&model=BMW"));
}
示例3: getModules
import org.jboss.aerogear.android.pipe.module.PipeModule; //导入依赖的package包/类
/**
* Modules are bits of functionality which are called during a Pipes
* lifecycle.
*
* @return the current List of Modules
*/
public abstract List<PipeModule> getModules();