atg.commerce.pricing.definition
Class DiscountStructure

java.lang.Object
  extended by atg.commerce.pricing.definition.DiscountStructure

public class DiscountStructure
extends java.lang.Object

Holds information about the discount to apply to target items for a promotion

Properties:

See Also:
DiscountDetail

Field Summary
static java.lang.String CLASS_VERSION
          Class version string
 
Constructor Summary
DiscountStructure(java.lang.String pCalculatorType)
          Constructor.
 
Method Summary
 void addAttribute(java.lang.String pName, java.lang.Object pValue)
          Adds an attribute to the attribute map.
 void addDiscountDetail(DiscountDetail pDiscountDetail)
          Adds a discount details to the discountDetails list.
 java.lang.Double getAdjuster()
          Getter for the adjuster property.
 java.util.Map<java.lang.String,java.lang.Object> getAttributes()
          Getter for the 'attributes' property
 java.lang.String getCalculatorType()
          Getter for the 'calculatorType' property.
 java.util.List<DiscountDetail> getDiscountDetails()
          Getter for the discountDetails property.
 int getDiscountIndex()
          Getter for the 'discountIndex' property
The index of this discount structure if it is just one of many in a promotion.
 java.lang.String getDiscountType()
          Getter for the 'discountType' property.
 void setAdjuster(java.lang.Double pAdjuster)
          Setter for the adjuster property.
 void setAttributes(java.util.Map<java.lang.String,java.lang.Object> pAttributes)
          Setter for the 'attributes' property.
 void setCalculatorType(java.lang.String pCalculatorType)
          Setter for the 'calculatorType' property.
 void setDiscountDetails(java.util.List<DiscountDetail> pDiscountDetails)
          Setter for the discountDetails property.
 void setDiscountIndex(int pDiscountIndex)
          Setter for the 'discountIndex' property
The index of this discount structure if it is just one of many in a promotion.
 void setDiscountType(java.lang.String pDiscountType)
          Setter for the 'discountType' property.
 java.lang.String toString()
          Writes out this object
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

CLASS_VERSION

public static final java.lang.String CLASS_VERSION
Class version string

See Also:
Constant Field Values
Constructor Detail

DiscountStructure

public DiscountStructure(java.lang.String pCalculatorType)
Constructor.
Takes the calculator type as the required parameter.

Parameters:
pCalculatorType - String calculator type.
Method Detail

getDiscountIndex

public int getDiscountIndex()
Getter for the 'discountIndex' property
The index of this discount structure if it is just one of many in a promotion.
This allows us to keep track if an item is involved in multiple discounts.
Index defaults and starts from 0.

Returns:
discountIndex defaults to 0.

setDiscountIndex

public void setDiscountIndex(int pDiscountIndex)
Setter for the 'discountIndex' property
The index of this discount structure if it is just one of many in a promotion.
This allows us to keep track if an item is involved in multiple discounts.
Index defaults and starts from 0.

Parameters:
pDiscountIndex - int discountIndex defaults to 0.

getCalculatorType

public java.lang.String getCalculatorType()
Getter for the 'calculatorType' property.
String calculator type.
Pricing engine has a map of calculator type to the calculator component.
e.g. standard, bulk, tiered

Returns:
String calculator type

setCalculatorType

public void setCalculatorType(java.lang.String pCalculatorType)
Setter for the 'calculatorType' property.
String calculator type.
Pricing engine has a map of calculator type to the calculator component.
e.g. standard, bulk, tiered

Parameters:
pCalculatorType - String calculator type

getDiscountType

public java.lang.String getDiscountType()
Getter for the 'discountType' property.
String discount type the calculator should apply.
e.g. percentOff, amountOff, fixedPrice

Returns:
String discount type

setDiscountType

public void setDiscountType(java.lang.String pDiscountType)
Setter for the 'discountType' property.
String discount type the calculator should apply.
e.g. percentOff, amountOff, fixedPrice

Parameters:
pDiscountType - String discount type

getAdjuster

public java.lang.Double getAdjuster()
Getter for the adjuster property.
Double amount the calculator can use to adjust the price.
For some discount types this property may be null,
e.g. for bulk discount the adjuster amount is determined in
the discount details.

Defaults to null.

Returns:
Double adjuster amount

setAdjuster

public void setAdjuster(java.lang.Double pAdjuster)
Setter for the adjuster property.
Double amount the calculator can use to adjust the price.
For some discount types this property may be null,
e.g. for bulk discount the adjuster amount is determined in
the discount details.

Defaults to null.

Parameters:
pAdjuster - Double adjuster amount

getDiscountDetails

public java.util.List<DiscountDetail> getDiscountDetails()
Getter for the discountDetails property.
List of DiscountDetail objects to further describe this discount type.
e.g. in tiered discount there will be a DiscountDetail object for each tier.

Returns:
List of DiscountDetail

setDiscountDetails

public void setDiscountDetails(java.util.List<DiscountDetail> pDiscountDetails)
Setter for the discountDetails property.
List of DiscountDetail objects to further describe this discount type.
e.g. in tiered discount there will be a DiscountDetail object for each tier.

Parameters:
pDiscountDetails - List of DiscountDetail

getAttributes

public java.util.Map<java.lang.String,java.lang.Object> getAttributes()
Getter for the 'attributes' property

Returns:
Map of String name to value object entries

setAttributes

public void setAttributes(java.util.Map<java.lang.String,java.lang.Object> pAttributes)
Setter for the 'attributes' property.

Parameters:
pAttributes - Map of String name to value object entries

addDiscountDetail

public void addDiscountDetail(DiscountDetail pDiscountDetail)
Adds a discount details to the discountDetails list. Creates the list if needed.

Parameters:
pDiscountDetail - DiscountDetail to add

addAttribute

public void addAttribute(java.lang.String pName,
                         java.lang.Object pValue)
Adds an attribute to the attribute map. Creates the map if needed.

Parameters:
pName - String attribute name
pValue - Object attribute value

toString

public java.lang.String toString()
Writes out this object

Overrides:
toString in class java.lang.Object
Returns:
String