public class AggregatorManager
extends java.lang.Object
| Modifier and Type | Field and Description | 
|---|---|
| static java.lang.String | CLASS_VERSIONClass version string | 
| Constructor and Description | 
|---|
| AggregatorManager() | 
| Modifier and Type | Method and Description | 
|---|---|
| AggregatorInfo | calculate(java.lang.String pAggregator,
         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 call the correct aggregator based on the given pAggregator
 parameter. | 
| java.util.Set<java.lang.String> | getAggregatorKeys()Returns a list of the aggregator keys. | 
| ServiceMap | getAggregators()Get the aggregators. | 
| java.util.Set<java.lang.String> | getOperations()Returns a list of the combined operations that are available from all of the aggregators. | 
| java.util.Set<java.lang.String> | getOverriddenProperties()Returns a set of the properties that have been overridden by
 the aggregators. | 
| java.lang.String | getPropertyAggregatorKey()Get the property aggregator key. | 
| java.lang.String | getQuantityAggregatorKey()Get the quantity aggregator key. | 
| java.lang.String | getTotalOperationName()Get the total operation name property. | 
| boolean | isPropertyAggregator(java.lang.String pValue)Returns  trueif the given value indicates that it is
 related to a property aggregator. | 
| boolean | isValidAggregator(java.lang.String pAggregator)Returns  trueif the aggregator has been registered,falseotherwise. | 
| boolean | isValidOperation(java.lang.String pOperation,
                java.lang.String pAggregator)Returns  trueif the given operation is valid for the given
 aggregator,falseotherwise. | 
| java.lang.String | parseToLocalizedValue(java.lang.String pAggregator,
                     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 pAggregator,
          java.lang.String pValue,
          java.lang.Class<?> pType)Parses a string value and returns a Number representation. | 
| void | setAggregators(ServiceMap pAggregators)Setter for the aggregators property. | 
| void | setTotalOperationName(java.lang.String pTotalOperationName)Set the total operation name. | 
| protected void | setupAggregatorKeys()Sets the key names of the quantity and property
 aggregators based on the key defined in the
 aggregators map. | 
public void setAggregators(ServiceMap pAggregators)
pAggregators - map of aggregatorspublic ServiceMap getAggregators()
public void setTotalOperationName(java.lang.String pTotalOperationName)
pTotalOperationName - the total operation namepublic java.lang.String getTotalOperationName()
public java.lang.String getQuantityAggregatorKey()
public java.lang.String getPropertyAggregatorKey()
protected void setupAggregatorKeys()
public java.util.Set<java.lang.String> getOperations()
public java.util.Set<java.lang.String> getAggregatorKeys()
public AggregatorInfo calculate(java.lang.String pAggregator, java.lang.String pOperation, java.lang.Double pAggValueSoFar, java.lang.Long pQuantityMatched, java.lang.Double pTargetValue, CommerceItem pItem, java.util.Map pAttributes) throws PricingException
pAggregator - the name of the aggregator topOperation - 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 - if an error occurred whilst calculatingpublic java.util.Set<java.lang.String> getOverriddenProperties()
public boolean isValidOperation(java.lang.String pOperation,
                       java.lang.String pAggregator)
true if the given operation is valid for the given
 aggregator, false otherwise. Will also return false
 if the aggregator has not been registered.
 The total operation for the quantity aggregator is always valid, no matter if
 the aggregator has been registered or not.pOperation - the name of the operation to validatepAggregator - the name of the aggregator to validatetrue if the aggregator operation is valid, false otherwisepublic boolean isValidAggregator(java.lang.String pAggregator)
true if the aggregator has been registered,
 false otherwise.
 The quantity aggregator is always valid, no matter if it has
 been registered or not.pAggregator - the name of the aggregator to validatetrue if the aggregator is valid, false otherwisepublic boolean isPropertyAggregator(java.lang.String pValue)
true if the given value indicates that it is
 related to a property aggregator.pValue - value to checktrue if it can be determined that the given
 value relates to a property aggregator, false otherwisepublic java.lang.Number parseValue(java.lang.String pAggregator,
                          java.lang.String pValue,
                          java.lang.Class<?> pType)
                            throws java.lang.NumberFormatException
pAggregator - the name of the aggregatorpValue - value to be parsedpType - class type of pValuejava.lang.NumberFormatException - if pValue could not be parsedpublic java.lang.String parseToLocalizedValue(java.lang.String pAggregator,
                                     java.lang.String pValue,
                                     java.lang.Class<?> pType)
pAggregator - the name of the aggregatorpValue - value to be parsedpType - class type of pValuejava.lang.NumberFormatException - if pValue could not be parsed