本文整理匯總了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;
}