|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectatg.commerce.pricing.GWPInfo
public class GWPInfo
Contains information on the state of a GWP promotion.
There will be an instance of this class for each GWP promotion that qualifies and free gift selection given.
e.g. if a promotion gives away 1 shirt and 3 item in a GWP category then there would be two GWPInfo objects.
There is a 1-1 mapping between GWPInfo objects and the order markers that will be created to store information against the order.
If a GWP promotion applies a discount more than once or qualifies more than once then there is still only a
single instance however the quantity is incremented instead.
| Field Summary | |
|---|---|
static java.lang.String |
CLASS_VERSION
Class version string |
protected int |
mGiftHashCode
|
protected RepositoryItem |
mMarker
|
protected java.util.Map |
mOrderDetailsMap
|
protected java.lang.String |
mPromotionId
|
protected long |
mQuantity
|
protected java.util.Map<java.lang.String,java.lang.Long> |
mTargetedItemsMap
|
protected long |
mTargetedQuantity
|
| Constructor Summary | |
|---|---|
GWPInfo(java.lang.String pPromotionId,
DiscountDetail pDiscountDetail)
Constructor uses the discount detail from the GWP promotion to set the properties. |
|
| Method Summary | |
|---|---|
int |
getGiftHashCode()
Getter for the hash code of the discount detail PMDL that applies to this gift selection. |
java.util.UUID |
getLastTargetSetUUID()
Get property LastTargetSetUUID |
RepositoryItem |
getMarker()
Getter for the existing order marker related to this info (if any) |
java.util.Map |
getOrderDetailsMap()
Getter for the map of other order marker properties. |
java.lang.String |
getPromotionId()
Getter for the promotion id for this GWPInfo |
long |
getQuantity()
Getter for the total free quantity this gift selection offers. |
java.util.Map<java.lang.String,java.lang.Long> |
getTargetedItemsMap()
Getter for the map of commerce item id to quantity targeted to be free. |
long |
getTargetedQuantity()
Getter for the total targeted quantity for this gift selection, should add up to the sum of all quantities in the targetedItemsMap. |
void |
increaseQuantity(DiscountDetail pDiscountDetail)
Method to increase the quantity by the amount in the given discount detail |
void |
setGiftHashCode(int pGiftHashCode)
Setter for the hash code of the discount detail PMDL that applies to this gift selection. |
void |
setLastTargetSetUUID(java.util.UUID pLastTargetSetUUID)
Set property LastTargetSetUUID. |
void |
setMarker(RepositoryItem pMarker)
Setter for the existing order marker related to this info (if any) |
void |
setOrderDetailsMap(java.util.Map pOrderDetailsMap)
Setter for the map of other order marker properties. |
void |
setPromotionId(java.lang.String pPromotionId)
Setter for the promotion id for this GWPInfo |
void |
setQuantity(long pQuantity)
Setter for the total free quantity this gift selection offers. |
void |
setTargetedItemsMap(java.util.Map<java.lang.String,java.lang.Long> pTargetedItemsMap)
Setter for the map of commerce item id to quantity targeted to be free. |
void |
setTargetedQuantity(long pTargetedQuantity)
Setter for the total targeted quantity for this gift selection, should add up to the sum of all quantities in the targetedItemsMap. |
java.lang.String |
toString()
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
public static final java.lang.String CLASS_VERSION
protected java.lang.String mPromotionId
protected int mGiftHashCode
protected long mQuantity
protected long mTargetedQuantity
protected java.util.Map mOrderDetailsMap
protected java.util.Map<java.lang.String,java.lang.Long> mTargetedItemsMap
protected RepositoryItem mMarker
| Constructor Detail |
|---|
public GWPInfo(java.lang.String pPromotionId,
DiscountDetail pDiscountDetail)
throws PricingException
pPromotionId - String promotion id for this GWPInfopDiscountDetail - GWP promotion discount detail for this gift
PricingException - if the parameters are not valid| Method Detail |
|---|
public java.lang.String getPromotionId()
public void setPromotionId(java.lang.String pPromotionId)
pPromotionId - String promotion repository idpublic int getGiftHashCode()
public void setGiftHashCode(int pGiftHashCode)
pGiftHashCode - int hash codepublic long getQuantity()
public void setQuantity(long pQuantity)
pQuantity - long quantitypublic long getTargetedQuantity()
public void setTargetedQuantity(long pTargetedQuantity)
pTargetedQuantity - long quantitypublic java.util.Map getOrderDetailsMap()
public void setOrderDetailsMap(java.util.Map pOrderDetailsMap)
pOrderDetailsMap - Mappublic java.util.Map<java.lang.String,java.lang.Long> getTargetedItemsMap()
public void setTargetedItemsMap(java.util.Map<java.lang.String,java.lang.Long> pTargetedItemsMap)
pTargetedItemsMap - Mappublic RepositoryItem getMarker()
public void setMarker(RepositoryItem pMarker)
pMarker - RepositoryItem markerpublic void setLastTargetSetUUID(java.util.UUID pLastTargetSetUUID)
pLastTargetSetUUID - the UUID for the last target set that increased this GWPInfo quantitypublic java.util.UUID getLastTargetSetUUID()
public void increaseQuantity(DiscountDetail pDiscountDetail)
throws PricingException
pDiscountDetail - DiscountDetail to get quantity to add
PricingExceptionpublic java.lang.String toString()
toString in class java.lang.Object
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||