public class PromotionOrderEntry
extends java.lang.Object
implements java.lang.Comparable
| Constructor and Description |
|---|
PromotionOrderEntry(AbstractOrderEntry orderEntry,
PromotionEvaluationContext.ConsumptionLogger logger)
Constructor.
|
| Modifier and Type | Method and Description |
|---|---|
int |
compareTo(java.lang.Object o)
Compare to another object.
|
PromotionOrderEntryConsumed |
consume(SessionContext ctx,
AbstractPromotion promotion,
long quantity)
Inform the context that a promotion wishes to consume the specified property of.
|
AbstractOrderEntry |
getBaseOrderEntry()
Get the base order entry.
|
java.lang.Double |
getBasePrice(SessionContext ctx)
Returns the unit price of the product in this order entry.
|
java.util.List<Product> |
getBaseProducts(SessionContext ctx)
Returns a collection of base products for this order entry.
|
protected PromotionEvaluationContext.ConsumptionLogger |
getLogger() |
Product |
getProduct(SessionContext ctx)
Return the product for this order entry.
|
long |
getQuantity(SessionContext ctx)
Find the quantity of this orderEntry remaining after other promotions have run.
|
public PromotionOrderEntry(AbstractOrderEntry orderEntry, PromotionEvaluationContext.ConsumptionLogger logger)
orderEntry - The order entrylogger - The loggerpublic PromotionOrderEntryConsumed consume(SessionContext ctx, AbstractPromotion promotion, long quantity)
ctx - The currency context to usepromotion - The promotion wishing to consume some of an order entryquantity - The quantity of the order entry to consumepublic long getQuantity(SessionContext ctx)
ctx - The context to usepublic Product getProduct(SessionContext ctx)
Product or a
VariantProduct.ctx - The hybris contextProduct that this entry is forgetBaseProducts(de.hybris.platform.jalo.SessionContext)public java.util.List<Product> getBaseProducts(SessionContext ctx)
VariantProduct or
CompositeProduct otherwise the relevant base product is returned.ctx - The hybris contextProduct that this entry is forpublic java.lang.Double getBasePrice(SessionContext ctx)
ctx - The hybris contextpublic int compareTo(java.lang.Object o)
compareTo in interface java.lang.Comparableo - The object to compare toComparable.compareTo(T)public AbstractOrderEntry getBaseOrderEntry()
protected PromotionEvaluationContext.ConsumptionLogger getLogger()
Copyright © 2018 SAP SE. All Rights Reserved.