當前位置: 首頁>>代碼示例>>Java>>正文


Java BaseResult.fromResponse方法代碼示例

本文整理匯總了Java中cn.jiguang.common.resp.BaseResult.fromResponse方法的典型用法代碼示例。如果您正苦於以下問題:Java BaseResult.fromResponse方法的具體用法?Java BaseResult.fromResponse怎麽用?Java BaseResult.fromResponse使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在cn.jiguang.common.resp.BaseResult的用法示例。


在下文中一共展示了BaseResult.fromResponse方法的6個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: sendPush

import cn.jiguang.common.resp.BaseResult; //導入方法依賴的package包/類
public PushResult sendPush(PushPayload pushPayload) throws APIConnectionException, APIRequestException {
    Preconditions.checkArgument(! (null == pushPayload), "pushPayload should not be null");
    
    if (_apnsProduction > 0) {
        pushPayload.resetOptionsApnsProduction(true);
    } else if(_apnsProduction == 0) {
        pushPayload.resetOptionsApnsProduction(false);
    }

    if (_timeToLive >= 0) {
        pushPayload.resetOptionsTimeToLive(_timeToLive);
    }

    ResponseWrapper response = _httpClient.sendPost(_baseUrl + _pushPath, pushPayload.toString());
    
    return BaseResult.fromResponse(response, PushResult.class);
}
 
開發者ID:cowthan,項目名稱:JavaAyo,代碼行數:18,代碼來源:PushClient.java

示例2: sendPushValidate

import cn.jiguang.common.resp.BaseResult; //導入方法依賴的package包/類
public PushResult sendPushValidate(PushPayload pushPayload) throws APIConnectionException, APIRequestException {
    Preconditions.checkArgument(! (null == pushPayload), "pushPayload should not be null");
    
    if (_apnsProduction > 0) {
        pushPayload.resetOptionsApnsProduction(true);
    } else if(_apnsProduction == 0) {
        pushPayload.resetOptionsApnsProduction(false);
    }

    if (_timeToLive >= 0) {
        pushPayload.resetOptionsTimeToLive(_timeToLive);
    }
    
    ResponseWrapper response = _httpClient.sendPost(_baseUrl + _pushValidatePath, pushPayload.toString());
    
    return BaseResult.fromResponse(response, PushResult.class);
}
 
開發者ID:cowthan,項目名稱:JavaAyo,代碼行數:18,代碼來源:PushClient.java

示例3: getAliasDeviceList

import cn.jiguang.common.resp.BaseResult; //導入方法依賴的package包/類
public AliasDeviceListResult getAliasDeviceList(String alias, String platform) throws APIConnectionException, APIRequestException {
    String url = hostName + aliasesPath + "/" + alias;
    if (null != platform) {
    	url += "?platform=" + platform; 
    }
    
    ResponseWrapper response = _httpClient.sendGet(url);
    
    return BaseResult.fromResponse(response, AliasDeviceListResult.class);
}
 
開發者ID:cowthan,項目名稱:JavaAyo,代碼行數:11,代碼來源:DeviceClient.java

示例4: getUsers

import cn.jiguang.common.resp.BaseResult; //導入方法依賴的package包/類
public UsersResult getUsers(TimeUnit timeUnit, String start, int duration) 
        throws APIConnectionException, APIRequestException {        
    String startEncoded = null;
    try {
        startEncoded = URLEncoder.encode(start, "utf-8");
    } catch (Exception e) {
    }
    
    String url = _hostName + _userPath
            + "?time_unit=" + timeUnit.toString()
            + "&start=" + startEncoded + "&duration=" + duration;
    ResponseWrapper response = _httpClient.sendGet(url);
    
    return BaseResult.fromResponse(response, UsersResult.class);
}
 
開發者ID:cowthan,項目名稱:JavaAyo,代碼行數:16,代碼來源:ReportClient.java

示例5: isDeviceInTag

import cn.jiguang.common.resp.BaseResult; //導入方法依賴的package包/類
public BooleanResult isDeviceInTag(String theTag, String registrationID) throws APIConnectionException, APIRequestException {
    String url = hostName + tagsPath + "/" + theTag + "/registration_ids/" + registrationID;
    ResponseWrapper response = _httpClient.sendGet(url);
    
    return BaseResult.fromResponse(response, BooleanResult.class);        
}
 
開發者ID:cowthan,項目名稱:JavaAyo,代碼行數:7,代碼來源:DeviceClient.java

示例6: getDeviceTagAlias

import cn.jiguang.common.resp.BaseResult; //導入方法依賴的package包/類
public TagAliasResult getDeviceTagAlias(String registrationId) throws APIConnectionException, APIRequestException {
    String url = hostName + devicesPath + "/" + registrationId;
    
    ResponseWrapper response = _httpClient.sendGet(url);
    
    return BaseResult.fromResponse(response, TagAliasResult.class);
}
 
開發者ID:cowthan,項目名稱:JavaAyo,代碼行數:8,代碼來源:DeviceClient.java


注:本文中的cn.jiguang.common.resp.BaseResult.fromResponse方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。