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