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 double |
mQuantityWithFraction |
protected java.util.Map<java.lang.String,java.lang.Long> |
mTargetedItemsMap |
protected java.util.Map<java.lang.String,java.lang.Double> |
mTargetedItemsWithFractionMap |
protected long |
mTargetedQuantity |
protected double |
mTargetedQuantityWithFraction |
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.
|
double |
getQuantityDerivedAsFloatingPoint()
This method will return a derived quantity value which this object represents.
|
double |
getQuantityWithFraction()
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.
|
java.util.Map<java.lang.String,java.lang.Double> |
getTargetedItemsWithFractionMap()
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.
|
double |
getTargetedQuantityDerivedAsFloatingPoint()
This method will return a derived quantity value which this object represents.
|
double |
getTargetedQuantityWithFraction()
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 |
setQuantityWithFraction(double pQuantityWithFraction)
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 |
setTargetedItemsWithFractionMap(java.util.Map<java.lang.String,java.lang.Double> pTargetedItemsWithFractionMap)
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.
|
void |
setTargetedQuantityWithFraction(double pTargetedQuantityWithFraction)
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 double mQuantityWithFraction
protected long mTargetedQuantity
protected double mTargetedQuantityWithFraction
protected java.util.Map mOrderDetailsMap
protected java.util.Map<java.lang.String,java.lang.Long> mTargetedItemsMap
protected java.util.Map<java.lang.String,java.lang.Double> mTargetedItemsWithFractionMap
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 double getQuantityWithFraction()
public void setQuantityWithFraction(double pQuantityWithFraction)
pQuantityWithFraction
- double quantitypublic double getQuantityDerivedAsFloatingPoint()
It will decide upon the correct quantity value to return, returning the first non-zero
value from the properties, quantityWithFraction
, quantity
, in that order.
The method should be used where there is a need to know the quantity but it is unknown
(or not important) to the caller as to which property (quantityWithFraction
or
quantity
holds the value.
public long getTargetedQuantity()
public void setTargetedQuantity(long pTargetedQuantity)
pTargetedQuantity
- long quantitypublic double getTargetedQuantityWithFraction()
public void setTargetedQuantityWithFraction(double pTargetedQuantityWithFraction)
pTargetedQuantityWithFraction
- long quantitypublic double getTargetedQuantityDerivedAsFloatingPoint()
It will decide upon the correct quantity value to return, returning the first non-zero
value from the properties, targetedQuantityWithFraction
, targetedQuantity
,
in that order.
The method should be used where there is a need to know the quantity but it is unknown
(or not important) to the caller as to which property (quantityWithFraction
or
quantity
holds the value.
public 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 java.util.Map<java.lang.String,java.lang.Double> getTargetedItemsWithFractionMap()
public void setTargetedItemsWithFractionMap(java.util.Map<java.lang.String,java.lang.Double> pTargetedItemsWithFractionMap)
pTargetedItemsWithFractionMap
- 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