|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectatg.nucleus.logging.VariableArgumentApplicationLoggingImpl
atg.nucleus.logging.ApplicationLoggingImpl
atg.commerce.pricing.BandedDiscountCalculatorHelper
public class BandedDiscountCalculatorHelper
A helper class with methods common to all banded calculators for use.
| Nested Class Summary | |
|---|---|
class |
BandedDiscountCalculatorHelper.Band
Internal class to represent a band in the banded promotion |
| Field Summary | |
|---|---|
static java.lang.String |
ADJUSTER_ATTRIBUTE
PMDL 'adjuster' attribute |
static java.lang.String |
BAND_ATTRIBUTE
PMDL 'band' attribute |
static java.lang.String |
BANDING_PROPERTY_ATTRIBUTE
PMDL 'bandingProperty' attribute |
static java.lang.String |
BANDING_PROPERTY_SCOPE_ATTRIBUTE
PMDL 'bandingPropertyScope' attribute |
static java.lang.String |
BANDING_PROPERTY_SCOPE_DIPI
PMDL banding property scope - "DetailedItemPriceInfo" |
static java.lang.String |
BANDING_PROPERTY_SCOPE_QUALIFIED_ITEM
PMDL banding property scope - "QualifiedItem" |
static java.lang.String |
CLASS_VERSION
Class version string |
| Fields inherited from interface atg.nucleus.logging.TraceApplicationLogging |
|---|
DEFAULT_LOG_TRACE_STATUS |
| Fields inherited from interface atg.nucleus.logging.ApplicationLogging |
|---|
DEFAULT_LOG_DEBUG_STATUS, DEFAULT_LOG_ERROR_STATUS, DEFAULT_LOG_INFO_STATUS, DEFAULT_LOG_WARNING_STATUS |
| Constructor Summary | |
|---|---|
BandedDiscountCalculatorHelper()
Constructor. |
|
| Method Summary | |
|---|---|
protected double |
calculateBandingValue(java.lang.String pBandingPropertyScope,
java.util.Map<java.lang.String,java.lang.Object> pObjectBindings,
java.util.Collection pQualifiedItems)
Determines the banding value to use. |
protected java.util.Map<java.lang.String,java.lang.Object> |
createBindings(java.lang.String pBandingProperty,
java.util.Map pExtraParameters)
Method to create an object bindings map with the objects that are required to determine the banding property value. |
protected BandedDiscountCalculatorHelper.Band |
determineBand(double pBandingValue,
java.util.List<BandedDiscountCalculatorHelper.Band> pBands)
Determines which band to use based on the banding value. |
protected java.util.List<BandedDiscountCalculatorHelper.Band> |
determineBands(java.util.List<DiscountDetail> pDetails)
Determines the bands from the discount details and sorts them. |
double |
getAdjuster(RepositoryItem pPricingModel,
java.util.Collection pQualifiedItems,
java.util.Map pExtraParameters,
java.lang.String pDefaultBandingProperty,
java.lang.String pDefaultBandingPropertyScope)
Determines the amount of adjustment to apply. |
protected double |
getBandingPropertyValue(java.util.Map<java.lang.String,java.lang.Object> pObjectBindings)
This method resolves the banding property value. |
CalculatorInfo |
getCalculatorInfo(java.lang.String pCalculatorType)
Provide a CalculatorInfo for the calculator |
| Methods inherited from class atg.nucleus.logging.VariableArgumentApplicationLoggingImpl |
|---|
vlogDebug, vlogDebug, vlogDebug, vlogDebug, vlogDebugTrace, vlogError, vlogError, vlogError, vlogError, vlogInfo, vlogInfo, vlogInfo, vlogInfo, vlogTrace, vlogTrace, vlogTrace, vlogTrace, vlogWarning, vlogWarning, vlogWarning, vlogWarning |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final java.lang.String CLASS_VERSION
public static final java.lang.String BANDING_PROPERTY_ATTRIBUTE
public static final java.lang.String BANDING_PROPERTY_SCOPE_ATTRIBUTE
public static final java.lang.String BAND_ATTRIBUTE
public static final java.lang.String ADJUSTER_ATTRIBUTE
public static final java.lang.String BANDING_PROPERTY_SCOPE_DIPI
public static final java.lang.String BANDING_PROPERTY_SCOPE_QUALIFIED_ITEM
| Constructor Detail |
|---|
public BandedDiscountCalculatorHelper()
| Method Detail |
|---|
public double getAdjuster(RepositoryItem pPricingModel,
java.util.Collection pQualifiedItems,
java.util.Map pExtraParameters,
java.lang.String pDefaultBandingProperty,
java.lang.String pDefaultBandingPropertyScope)
throws PricingException
pPricingModel - RepositoryItem pricing modelpQualifiedItems - Collection of QualifiedItem objectspExtraParameters - Map of optional extra parameters, may be nullpDefaultBandingProperty - String default banding property to usepDefaultBandingPropertyScope - String default banding property scope to use
PricingException - if the method fails to get a valid double adjuster
protected java.util.Map<java.lang.String,java.lang.Object> createBindings(java.lang.String pBandingProperty,
java.util.Map pExtraParameters)
throws PricingException
pBandingProperty - String banding property namepExtraParameters - Map of extra parameters
PricingException
protected double calculateBandingValue(java.lang.String pBandingPropertyScope,
java.util.Map<java.lang.String,java.lang.Object> pObjectBindings,
java.util.Collection pQualifiedItems)
throws PricingException
pBandingPropertyScope - String bandingPropertyScope "QualifiedItem",
"DetailedItemPriceInfo" or null.pObjectBindings - Map of banded property objects to use.pQualifiedItems - Collection of QualifiedItem objects, can only be null if scope is null.
PricingException - for any problems determining the banding value to use.
protected double getBandingPropertyValue(java.util.Map<java.lang.String,java.lang.Object> pObjectBindings)
throws PricingException
pObjectBindings - Map of banding property objects to use
PricingException - if it fails to resolve the property value.
protected java.util.List<BandedDiscountCalculatorHelper.Band> determineBands(java.util.List<DiscountDetail> pDetails)
throws PricingException
pDetails - List of DiscountDetail from the discount structure
PricingException - for problems creating the bands, must be at least one band.
protected BandedDiscountCalculatorHelper.Band determineBand(double pBandingValue,
java.util.List<BandedDiscountCalculatorHelper.Band> pBands)
pBandingValue - double banding value to match withpBands - List of Band objects to search
public CalculatorInfo getCalculatorInfo(java.lang.String pCalculatorType)
pCalculatorType - String calculator type to set
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||