public class MatchingObject
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
CLASS_VERSION
Class version string
|
Constructor and Description |
---|
MatchingObject(java.lang.Object pMatchingObject,
long pQuantity)
Constructor to add a matched Object and quantity.
|
MatchingObject(java.lang.Object pMatchingObject,
long pQuantity,
double pQuantityWithFraction)
Constructor to add a matched Object and quantity (with fraction).
|
Modifier and Type | Method and Description |
---|---|
void |
addDiscount(DiscountStructure pDiscount)
Utility method to add another discount to the list of discounts.
|
java.util.List<DiscountStructure> |
getDiscounts()
Get property Discounts.
|
java.util.Map<java.lang.Integer,java.lang.Long> |
getGroupIndexQuantityMap()
Get property IndexQuantityMap
|
java.util.Map<java.lang.Integer,java.lang.Double> |
getGroupIndexQuantityWithFractionMap()
Get property IndexQuantityWithFractionMap
|
java.util.Map<java.lang.Integer,java.lang.Long> |
getIteratorIndexMap()
Get property IteratorIndexMap
|
java.util.Map<java.lang.Integer,java.lang.Double> |
getIteratorIndexQuantityWithFractionMap()
Get property IteratorIndexQuantityWithFractionMap
|
java.lang.Object |
getMatchingObject()
Get property MatchingObject
The object that matched, typically a FilteredCommerceItem |
long |
getQuantity()
Get property Quantity
The quantity of the object that matched |
double |
getQuantityDerivedAsFloatingPoint()
This method will return a derived quantity value which this object represents.
|
double |
getQuantityWithFraction()
Returns the quantity with fraction to add for a new commerce item
|
boolean |
isFractional()
If
getQuantityWithFraction is greater that 0.0, item is fractional. |
void |
setDiscounts(java.util.List<DiscountStructure> pDiscounts)
Set property Discounts
The List of discount structure of the object that matched |
void |
setGroupIndexQuantityMap(java.util.Map<java.lang.Integer,java.lang.Long> pGroupIndexQuantityMap)
Set property IndexQuantityMap
|
void |
setGroupIndexQuantityWithFractionMap(java.util.Map<java.lang.Integer,java.lang.Double> pGroupIndexQuantityWithFractionMap)
Set property IndexQuantityWithFractionMap
|
void |
setIteratorIndexMap(int pIteratorIndex,
long pMatchingQuantity)
Set property IteratorIndexMap
|
void |
setIteratorIndexQuantityWithFractionMap(int pIteratorIndex,
double pMatchingQuantityWithFraction)
Set property IteratorIndexQuantityWithFractionMap
|
void |
setMatchingObject(java.lang.Object pMatchingObject)
Set property MatchingObject
The object that matched, typically a FilteredCommerceItem |
void |
setQuantity(long pQuantity)
Set property Quantity
The quantity of the object that matched |
void |
setQuantityWithFraction(double pQuantityWithFraction)
Sets the quantity with fraction to add for a new commerce item
|
java.lang.String |
toString() |
public static final java.lang.String CLASS_VERSION
public MatchingObject(java.lang.Object pMatchingObject, long pQuantity)
pMatchingObject
- Object that matchedpQuantity
- long quantitypublic MatchingObject(java.lang.Object pMatchingObject, long pQuantity, double pQuantityWithFraction)
pMatchingObject
- Object that matchedpQuantity
- long quantitypQuantityWithFraction
- double quantity (with fraction)public void setMatchingObject(java.lang.Object pMatchingObject)
pMatchingObject
- new Object value to setpublic java.lang.Object getMatchingObject()
public void setQuantity(long pQuantity)
pQuantity
- long new quantity to setpublic long getQuantity()
public void setQuantityWithFraction(double pQuantityWithFraction)
pQuantityWithFraction
- represents the fractional quantity.public double getQuantityWithFraction()
double
value.public 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 of an item
but it is unknown to the caller as to which property (quantityWithFraction
or
quantity
holds the value.
public boolean isFractional()
getQuantityWithFraction
is greater that 0.0, item is fractional.public void setDiscounts(java.util.List<DiscountStructure> pDiscounts)
pDiscounts
- new DiscountStructure List to setpublic java.util.List<DiscountStructure> getDiscounts()
public void setIteratorIndexMap(int pIteratorIndex, long pMatchingQuantity)
pIteratorIndex
- the index of the iterator that this object matched inpMatchingQuantity
- the matching quantity found for the given iteratorpublic java.util.Map<java.lang.Integer,java.lang.Long> getIteratorIndexMap()
public void setIteratorIndexQuantityWithFractionMap(int pIteratorIndex, double pMatchingQuantityWithFraction)
pIteratorIndex
- the index of the iterator that this object matched inpMatchingQuantityWithFraction
- the matching quantity found for the given iteratorpublic java.util.Map<java.lang.Integer,java.lang.Double> getIteratorIndexQuantityWithFractionMap()
public java.util.Map<java.lang.Integer,java.lang.Long> getGroupIndexQuantityMap()
public void setGroupIndexQuantityMap(java.util.Map<java.lang.Integer,java.lang.Long> pGroupIndexQuantityMap)
pGroupIndexQuantityMap
- - a map associating quantities from this matching
object with discount groups.public java.util.Map<java.lang.Integer,java.lang.Double> getGroupIndexQuantityWithFractionMap()
public void setGroupIndexQuantityWithFractionMap(java.util.Map<java.lang.Integer,java.lang.Double> pGroupIndexQuantityWithFractionMap)
pGroupIndexQuantityWithFractionMap
- - a map associating quantities from this matching
object with discount groups.public void addDiscount(DiscountStructure pDiscount)
pDiscount
- DiscountStructure to addpublic java.lang.String toString()
toString
in class java.lang.Object