当前位置: 首页>>代码示例>>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;未经允许,请勿转载。