public class PropertyAggregator extends Aggregator
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
CLASS_VERSION
Class version string
|
mDecimalFormatString, mWholeNumberFormatString
Constructor and Description |
---|
PropertyAggregator() |
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 value using pItem.
|
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 string value and returns a Number representation.
|
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
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 valuepQuantityWithFractionMatched
- the number of items that have contributed to the
aggregated value. This will take precedence over pQuantityMatched
if value set on parameter.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
public 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