private String getAddonBadgeAssetId() { if (shippingInfo != null && shippingInfo.getAddOn() != null) { return shippingInfo.getAddOn().getBadgeAssetId(); } if (mainPrice != null && mainPrice.getShipping() != null && mainPrice.getShipping().getAddOn() != null) { return mainPrice.getShipping().getAddOn().getBadgeAssetId(); } else { return null; } }
public PriceModel build( Prices prices, PriceInfo priceinfo, Shipping shipping, boolean flag, boolean flag1, boolean flag2, boolean flag3) { mainPrice = priceinfo; shippingInfo = shipping; if (priceinfo == null) { prices = null; } else { PriceModel pricemodel = new PriceModel(); if (flag2) { pricemodel.setListPrice(priceinfo.getListPrice()); } Object obj; if (flag1) { obj = priceinfo.getPostLinkText(); } else { obj = priceinfo.getPrice(); } pricemodel.setPrice(((String) (obj))); if (priceinfo.getMap() != null) { pricemodel.setMapTextId( Integer.valueOf(com.amazon.retailsearch.R.string.item_map_instructions)); } if (!TextUtils.isEmpty(priceinfo.getUnitPrice())) { pricemodel.setUnitOrIssuePrice(priceinfo.getUnitPrice()); } else if (!TextUtils.isEmpty(priceinfo.getIssuePrice())) { pricemodel.setUnitOrIssuePrice(priceinfo.getIssuePrice()); } priceinfo = ProductUtil.getPrimeProgramBadgeId(ProductUtil.getShipping(prices, shipping)); obj = getAddonBadgeAssetId(); if (obj != null) { pricemodel.setBadgeId(((String) (obj))); } else if (priceinfo != null) { pricemodel.setBadgeId(priceinfo); } pricemodel.setUseEditions(flag); if (prices != null && prices.getEditions() != null) { priceinfo = prices.getEditions(); prices = new ArrayList(priceinfo.size()); for (priceinfo = priceinfo.iterator(); priceinfo.hasNext(); ) { obj = (EditionsPriceInfo) priceinfo.next(); if (!TextUtils.isEmpty(((EditionsPriceInfo) (obj)).getPrice())) { UIPriceInfo uipriceinfo = new UIPriceInfo(); uipriceinfo.setPrice(((EditionsPriceInfo) (obj)).getPrice()); uipriceinfo.setLabel(((EditionsPriceInfo) (obj)).getLink().getText()); prices.add(uipriceinfo); } } pricemodel.setEditions(prices); } if (flag3 && shipping != null && shipping.getPrime() != null) { pricemodel.setSomePrimeMsg(shipping.getPrime().getMessage()); } prices = pricemodel; if (flag1) { pricemodel.setSponsoredPriceMsg(buildSponsoredPriceMsg()); return pricemodel; } } return prices; }