本文整理汇总了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;
}
示例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;
}
示例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();
}
}
示例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;
}
示例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);
}