public class SpendAmountAggregator extends Aggregator
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
CLASS_VERSION
Class version string
|
mDecimalFormatString, mWholeNumberFormatString
Constructor and Description |
---|
SpendAmountAggregator() |
Modifier and Type | Method and Description |
---|---|
protected AggregatorInfo |
calculate(java.lang.String pOperation,
java.lang.Double pAggValueSoFar,
java.lang.Long pQuantityMatched,
java.lang.Double pTargetValue,
CommerceItem pItem,
java.util.Map pAttributes)
This method will calculate (based on the given operation) an aggregated amount value for pItem based on
it's collection of DetailedItemPriceInfo objects.
|
protected AggregatorInfo |
calculate(java.lang.String pOperation,
java.lang.Double pAggValueSoFar,
java.lang.Long pQuantityMatched,
java.lang.Double pQuantityWithFractionMatched,
java.lang.Double pTargetValue,
CommerceItem pItem,
java.util.Map pAttributes)
This method will calculate (based on the given operation) an aggregated value using pItem.
|
java.lang.String |
parseToLocalizedValue(java.lang.String pValue,
java.lang.Class<?> pType)
Parses a string value and returns a localized string representation.
|
java.lang.Number |
parseValue(java.lang.String pValue,
java.lang.Class<?> pType)
Parses a localized string value and returns a Number representation,
suitable for use in the PMDL.
|
getDecimalFormatString, getOperations, getOverrideProperty, getWholeNumberFormatString, isValidOperation, setDecimalFormatString, setOperations, setOverrideProperty, setWholeNumberFormatString
protected AggregatorInfo calculate(java.lang.String pOperation, java.lang.Double pAggValueSoFar, java.lang.Long pQuantityMatched, java.lang.Double pTargetValue, CommerceItem pItem, java.util.Map pAttributes) throws PricingException
pOperation
- the operation to invoke on the aggregatorpAggValueSoFar
- the aggregated value so far, which may be potentially
derived from many calculations from multiple itemspQuantityMatched
- the number of items that have contributed to the
aggregated valuepTargetValue
- a value specified in the condition/offer of a promotion
which can be used as a target in relation to the aggregated value.
May or may not be relevant to an aggregatorpItem
- the item that is currently being evaluatedpAttributes
- extra parametersPricingException
protected AggregatorInfo calculate(java.lang.String pOperation, java.lang.Double pAggValueSoFar, java.lang.Long pQuantityMatched, java.lang.Double pQuantityWithFractionMatched, java.lang.Double pTargetValue, CommerceItem pItem, java.util.Map pAttributes) throws PricingException
Aggregator
pOperation
- the operation to invoke on the aggregatorpAggValueSoFar
- the aggregated value so far, which may be potentially
derived from many calculations from multiple itemspQuantityMatched
- the number of items that have contributed to the
aggregated value.pQuantityWithFractionMatched
- the number of items that have contributed to the
aggregated value. Takes precedence over pQuantityMatched
if non-null
value passed.pTargetValue
- a value specified in the condition/offer of a promotion
which can be used as a target in relation to the aggregated value.
May or may not be relevant to an aggregatorpItem
- the item that is currently being evaluatedpAttributes
- extra parametersPricingException
- if an error occurred during calculationpublic java.lang.Number parseValue(java.lang.String pValue, java.lang.Class<?> pType) throws java.lang.NumberFormatException
pValue
- value to be parsedpType
- class type of pValuejava.lang.NumberFormatException
- if pValue could not be parsedpublic java.lang.String parseToLocalizedValue(java.lang.String pValue, java.lang.Class<?> pType) throws java.lang.NumberFormatException
parseToLocalizedValue
in class Aggregator
pValue
- value to be parsedpType
- class type of pValuejava.lang.NumberFormatException
- if pValue could not be parsed