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


Java PaymentAddress類代碼示例

本文整理匯總了Java中org.chromium.payments.mojom.PaymentAddress的典型用法代碼示例。如果您正苦於以下問題:Java PaymentAddress類的具體用法?Java PaymentAddress怎麽用?Java PaymentAddress使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


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

示例1: toPaymentAddress

import org.chromium.payments.mojom.PaymentAddress; //導入依賴的package包/類
/** @return The address for the merchant. */
public PaymentAddress toPaymentAddress() {
    assert mIsComplete;
    PaymentAddress result = new PaymentAddress();

    result.country = getCountryCode(mProfile);
    result.addressLine = mProfile.getStreetAddress().split("\n");
    result.region = mProfile.getRegion();
    result.city = mProfile.getLocality();
    result.dependentLocality = mProfile.getDependentLocality();
    result.postalCode = mProfile.getPostalCode();
    result.sortingCode = mProfile.getSortingCode();
    result.organization = mProfile.getCompanyName();
    result.recipient = mProfile.getFullName();
    result.languageCode = "";
    result.scriptCode = "";
    result.phone = mProfile.getPhoneNumber();

    if (mProfile.getLanguageCode() == null) return result;

    if (mLanguageScriptCodePattern == null) {
        mLanguageScriptCodePattern = Pattern.compile(LANGUAGE_SCRIPT_CODE_PATTERN);
    }

    Matcher matcher = mLanguageScriptCodePattern.matcher(mProfile.getLanguageCode());
    if (matcher.matches()) {
        result.languageCode = ensureNotNull(matcher.group(LANGUAGE_CODE_GROUP));
        result.scriptCode = ensureNotNull(matcher.group(SCRIPT_CODE_GROUP));
    }

    return result;
}
 
開發者ID:rkshuai,項目名稱:chromium-for-android-56-debug-video,代碼行數:33,代碼來源:AutofillAddress.java


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