public class GWPInfo
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
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 and Description |
---|
GWPInfo(java.lang.String pPromotionId,
DiscountDetail pDiscountDetail,
int pOfferCount)
Constructor uses the discount detail from the GWP promotion to
set the properties.
|
Modifier and Type | Method and Description |
---|---|
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<QualifiedItem,java.lang.Integer> |
getTargetableItems() |
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,
int pOfferCount)
Method to increase the quantity by the amount in the given discount detail
|
void |
merge(GWPInfo pGWPInfo)
Merge the given GWPInfo with this one.
|
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 |
setTargetableItems(java.util.Map<QualifiedItem,java.lang.Integer> pTargetableItems) |
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() |
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
public GWPInfo(java.lang.String pPromotionId, DiscountDetail pDiscountDetail, int pOfferCount) throws PricingException
pPromotionId
- String promotion id for this GWPInfopDiscountDetail
- GWP promotion discount detail for this giftpOfferCount
- int number of times this discount appliedPricingException
- if the parameters are not validpublic 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 java.util.Map<QualifiedItem,java.lang.Integer> getTargetableItems()
public void setTargetableItems(java.util.Map<QualifiedItem,java.lang.Integer> pTargetableItems)
public void increaseQuantity(DiscountDetail pDiscountDetail, int pOfferCount) throws PricingException
pDiscountDetail
- DiscountDetail to get quantity to addpOfferCount
- int number of times this discount offer should applyPricingException
public void merge(GWPInfo pGWPInfo)
pGWPInfo
- public java.lang.String toString()
toString
in class java.lang.Object