本文整理匯總了Java中com.gc.android.market.api.model.Market.RequestContext類的典型用法代碼示例。如果您正苦於以下問題:Java RequestContext類的具體用法?Java RequestContext怎麽用?Java RequestContext使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。
RequestContext類屬於com.gc.android.market.api.model.Market包,在下文中一共展示了RequestContext類的6個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的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);
}
示例6: getContext
import com.gc.android.market.api.model.Market.RequestContext; //導入依賴的package包/類
public RequestContext.Builder getContext() {
return context;
}