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


Java RequestContext.newBuilder方法代码示例

本文整理汇总了Java中com.gc.android.market.api.model.Market.RequestContext.newBuilder方法的典型用法代码示例。如果您正苦于以下问题:Java RequestContext.newBuilder方法的具体用法?Java RequestContext.newBuilder怎么用?Java RequestContext.newBuilder使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在com.gc.android.market.api.model.Market.RequestContext的用法示例。


在下文中一共展示了RequestContext.newBuilder方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: queryApp

import com.gc.android.market.api.model.Market.RequestContext; //导入方法依赖的package包/类
public List<Object> queryApp(AppsRequest requestGroup)
{
	List<Object> retList = new ArrayList<Object>();
	
	request.addRequestGroup(RequestGroup.newBuilder().setAppsRequest(requestGroup));
	
	RequestContext ctxt = context.build();
	context = RequestContext.newBuilder(ctxt);
	request.setContext(ctxt);
	try {
		Response resp = executeProtobuf(request.build());
		for(ResponseGroup grp : resp.getResponseGroupList()) {
			if(grp.hasAppsResponse())
				retList.add(grp.getAppsResponse());
		}
	} finally {
		request = Request.newBuilder();
	}
	return retList;
}
 
开发者ID:hunatika615,项目名称:android-market-api,代码行数:21,代码来源:MarketSession.java

示例2: queryGetAssetRequest

import com.gc.android.market.api.model.Market.RequestContext; //导入方法依赖的package包/类
public GetAssetResponse queryGetAssetRequest(String assetId){
    setIsSecure(true);
    RequestContext ctxt = context.build();
    context = RequestContext.newBuilder(ctxt);
    request.setContext(ctxt);
    GetAssetResponse assetResponse = null;
    try {
        Response response = executeProtobuf(request.addRequestGroup(
                    RequestGroup.newBuilder().setGetAssetRequest(
                    GetAssetRequest.newBuilder().setAssetId(
                    assetId).build())).setContext(ctxt).build());
        assetResponse = response.getResponseGroup(0).getGetAssetResponse();
    } finally {
        setIsSecure(false);
        request = Request.newBuilder(); 
    }
    return assetResponse; 
}
 
开发者ID:hunatika615,项目名称:android-market-api,代码行数:19,代码来源:MarketSession.java

示例3: flush

import com.gc.android.market.api.model.Market.RequestContext; //导入方法依赖的package包/类
@SuppressWarnings("unchecked")
public void flush() {
	RequestContext ctxt = context.build();
	context = RequestContext.newBuilder(ctxt);
	request.setContext(ctxt);
	try {
		Response resp = executeProtobuf(request.build());
		int i = 0;
		for(ResponseGroup grp : resp.getResponseGroupList()) {
			Object val = null;
			if(grp.hasAppsResponse())
				val = grp.getAppsResponse();
			if(grp.hasCategoriesResponse())
				val = grp.getCategoriesResponse();
			if(grp.hasCommentsResponse())
				val = grp.getCommentsResponse();
			if(grp.hasImageResponse())
				val = grp.getImageResponse();
		((Callback)callbacks.get(i)).onResult(grp.getContext(), val);
			i++;
		}
	} finally {
		request = Request.newBuilder();
		callbacks.clear();
	}
}
 
开发者ID:hunatika615,项目名称:android-market-api,代码行数:27,代码来源:MarketSession.java

示例4: queryCategories

import com.gc.android.market.api.model.Market.RequestContext; //导入方法依赖的package包/类
public CategoriesResponse queryCategories() {
	RequestContext ctxt = context.build();
	context = RequestContext.newBuilder(ctxt);
	request.setContext(ctxt);
	CategoriesResponse categoriesResponse = null;
	try {
		Response response = executeProtobuf(request.addRequestGroup(
				RequestGroup.newBuilder().setCategoriesRequest(
						CategoriesRequest.newBuilder().build())).setContext(ctxt).build());
		categoriesResponse = response.getResponseGroup(0).getCategoriesResponse();
	} finally {
		request = Request.newBuilder();;
	}
	return categoriesResponse;
}
 
开发者ID:hunatika615,项目名称:android-market-api,代码行数:16,代码来源:MarketSession.java

示例5: execute

import com.gc.android.market.api.model.Market.RequestContext; //导入方法依赖的package包/类
public ResponseGroup execute(RequestGroup requestGroup) {
	RequestContext ctxt = context.build();
	context = RequestContext.newBuilder(ctxt);
	request.setContext(ctxt);
	Response resp = executeProtobuf(request.addRequestGroup(requestGroup).setContext(ctxt).build());
	return resp.getResponseGroup(0);
}
 
开发者ID:hunatika615,项目名称:android-market-api,代码行数:8,代码来源:MarketSession.java


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