Class PromotionOrderEntry
java.lang.Object
de.hybris.platform.promotions.result.PromotionOrderEntry
- All Implemented Interfaces:
Comparable
An entry as viewed from the PromotionEvaluationContext. This entry always shows the current state of the promotions
-
Constructor Summary
ConstructorsConstructorDescriptionPromotionOrderEntry(AbstractOrderEntry orderEntry, PromotionEvaluationContext.ConsumptionLogger logger) Constructor. -
Method Summary
Modifier and TypeMethodDescriptionintCompare to another object.consume(SessionContext ctx, AbstractPromotion promotion, long quantity) Inform the context that a promotion wishes to consume the specified property of.booleanGet the base order entry.Returns the unit price of the product in this order entry.Returns a collection of base products for this order entry.getProduct(SessionContext ctx) Return the product for this order entry.longFind the quantity of this orderEntry remaining after other promotions have run.inthashCode()
-
Constructor Details
-
PromotionOrderEntry
public PromotionOrderEntry(AbstractOrderEntry orderEntry, PromotionEvaluationContext.ConsumptionLogger logger) Constructor.- Parameters:
orderEntry- The order entrylogger- The logger
-
-
Method Details
-
consume
public PromotionOrderEntryConsumed consume(SessionContext ctx, AbstractPromotion promotion, long quantity) Inform the context that a promotion wishes to consume the specified property of.- Parameters:
ctx- The currency context to usepromotion- The promotion wishing to consume some of an order entryquantity- The quantity of the order entry to consume- Returns:
- The remaining quantity of the order entry
-
getQuantity
Find the quantity of this orderEntry remaining after other promotions have run.- Parameters:
ctx- The context to use- Returns:
- The remaining quantity
-
getProduct
Return the product for this order entry. Returns the actual product associated with the underlying order entry, this may be aProductor aVariantProduct.- Parameters:
ctx- The hybris context- Returns:
- The
Productthat this entry is for - See Also:
-
getBaseProducts
Returns a collection of base products for this order entry. Returns the current product if the product is not an instance ofVariantProductorCompositeProductotherwise the relevant base product is returned.- Parameters:
ctx- The hybris context- Returns:
- The base
Productthat this entry is for
-
getBasePrice
Returns the unit price of the product in this order entry.- Parameters:
ctx- The hybris context- Returns:
- The unit price of the product
-
compareTo
Compare to another object.- Specified by:
compareToin interfaceComparable- Parameters:
o- The object to compare to- Returns:
- See
Comparable.compareTo(T)
-
equals
-
hashCode
public int hashCode() -
getBaseOrderEntry
Get the base order entry.- Returns:
- the base order entry
-
getLogger
-