public class DefaultCurrencyAmountResolutionStrategy extends java.lang.Object implements PromotionMessageParameterResolutionStrategy
RuleParameterData.getValue() attribute into a
formatted currency amount, for example $200.00. The value attribute is cast into a Map<String,BigDecimal> and
the given PromotionResultModel.getOrder()'s currency isocode is used as key to lookup the amount to be
formatted.| Constructor and Description |
|---|
DefaultCurrencyAmountResolutionStrategy() |
| Modifier and Type | Method and Description |
|---|---|
protected java.text.DecimalFormat |
adjustDigits(java.text.DecimalFormat format,
CurrencyModel currency)
Adjusts
DecimalFormat's fraction digits according to given CurrencyModel. |
protected static java.text.DecimalFormat |
adjustSymbol(java.text.DecimalFormat format,
CurrencyModel currency)
Adjusts
DecimalFormat's symbol according to given CurrencyModel. |
protected java.lang.String |
formatCurrencyAmount(java.util.Locale locale,
CurrencyModel currency,
java.math.BigDecimal amount)
Format an amount in a currency for a locale.
|
protected PromotionResultUtils |
getPromotionResultUtils() |
RuleParameterData |
getReplacedParameter(RuleParameterData paramToReplace,
PromotionResultModel promotionResult,
java.lang.Object actualValueAsObject)
returns
RuleParameterData created from given RuleParameterData with replaced actual value. |
java.lang.String |
getValue(RuleParameterData data,
PromotionResultModel promotionResult,
java.util.Locale locale)
resolves the given
RuleParameterData into a displayable Object. |
void |
setPromotionResultUtils(PromotionResultUtils promotionResultUtils) |
public DefaultCurrencyAmountResolutionStrategy()
public java.lang.String getValue(RuleParameterData data, PromotionResultModel promotionResult, java.util.Locale locale)
PromotionMessageParameterResolutionStrategyRuleParameterData into a displayable Object.getValue in interface PromotionMessageParameterResolutionStrategydata - the rule parameter to resolvepromotionResult - the promotion resultlocale - the locale#toString()java.lang.IllegalArgumentException - if any of the given parameters is nulljava.lang.ClassCastException - if the given data.getValue() doesn't contain a Mappublic RuleParameterData getReplacedParameter(RuleParameterData paramToReplace, PromotionResultModel promotionResult, java.lang.Object actualValueAsObject)
PromotionMessageParameterResolutionStrategyRuleParameterData created from given RuleParameterData with replaced actual value.getReplacedParameter in interface PromotionMessageParameterResolutionStrategyparamToReplace - original rule parameterpromotionResult - the promotion resultactualValueAsObject - actual value to set#toString()protected java.lang.String formatCurrencyAmount(java.util.Locale locale,
CurrencyModel currency,
java.math.BigDecimal amount)
locale - the java locale that the amount should be rendered incurrency - the hybris currency model for the amountamount - the valueprotected java.text.DecimalFormat adjustDigits(java.text.DecimalFormat format,
CurrencyModel currency)
DecimalFormat's fraction digits according to given CurrencyModel.protected static java.text.DecimalFormat adjustSymbol(java.text.DecimalFormat format,
CurrencyModel currency)
DecimalFormat's symbol according to given CurrencyModel.protected PromotionResultUtils getPromotionResultUtils()
public void setPromotionResultUtils(PromotionResultUtils promotionResultUtils)
Copyright © 2018 SAP SE. All Rights Reserved.