public class PromotionOrderView
extends java.lang.Object
| Modifier | Constructor and Description |
|---|---|
protected |
PromotionOrderView(AbstractPromotion promotion,
java.util.List<PromotionOrderEntry> orderEntries) |
| Modifier and Type | Method and Description |
|---|---|
java.util.List<PromotionOrderEntryConsumed> |
consume(SessionContext ctx,
long quantity)
Consume a specific quantity of products from this view.
|
java.util.List<PromotionOrderEntryConsumed> |
consume(SessionContext ctx,
Product product,
long quantity)
Consume products from this view.
|
java.util.List<PromotionOrderEntryConsumed> |
consumeFromHead(SessionContext ctx,
java.util.Comparator<PromotionOrderEntry> comparator,
long quantity)
Consume products from this view in the specified order.
|
java.util.List<PromotionOrderEntryConsumed> |
consumeFromTail(SessionContext ctx,
java.util.Comparator<PromotionOrderEntry> comparator,
long quantity)
Consume products from this view in the reverse of the specfied order.
|
protected static java.util.List<PromotionOrderEntryConsumed> |
doConsume(SessionContext ctx,
java.util.List<PromotionOrderEntry> workingEntries,
AbstractPromotion promotion,
long quantity) |
protected static PromotionOrderEntry |
doPeek(SessionContext ctx,
java.util.List<PromotionOrderEntry> workingEntries) |
java.util.List<PromotionOrderEntry> |
getAllEntries(SessionContext ctx)
Get all the entries in this view.
|
java.util.List<PromotionOrderEntry> |
getAllEntriesByPrice(SessionContext ctx)
Get all the entries in this view sorted by price.
|
protected java.util.List<PromotionOrderEntry> |
getOrderEntries() |
protected AbstractPromotion |
getPromotion() |
long |
getQuantity(SessionContext ctx,
Product product)
Get the number of a single product remaining.
|
long |
getTotalQuantity(SessionContext ctx)
Get the total number of products remaining in this view.
|
PromotionOrderEntry |
peek(SessionContext ctx)
Look at the next promotion order entry from this view.
|
PromotionOrderEntry |
peekFromHead(SessionContext ctx,
java.util.Comparator<PromotionOrderEntry> comparator)
Look at the next promotion order entry from this view in the order specified.
|
PromotionOrderEntry |
peekFromTail(SessionContext ctx,
java.util.Comparator<PromotionOrderEntry> comparator)
Look at the next promotion order entry from this view in the reverse of the order specified.
|
protected PromotionOrderView(AbstractPromotion promotion, java.util.List<PromotionOrderEntry> orderEntries)
public long getTotalQuantity(SessionContext ctx)
ctx - the hybris contextpublic long getQuantity(SessionContext ctx, Product product)
ctx - the hybris contextproduct - the productpublic java.util.List<PromotionOrderEntryConsumed> consume(SessionContext ctx, long quantity)
ctx - the hybris contextquantity - the quantity to consumepublic java.util.List<PromotionOrderEntryConsumed> consumeFromHead(SessionContext ctx, java.util.Comparator<PromotionOrderEntry> comparator, long quantity)
ctx - the hybris contextcomparator - the comparatorquantity - the quantity to consumepublic java.util.List<PromotionOrderEntryConsumed> consumeFromTail(SessionContext ctx, java.util.Comparator<PromotionOrderEntry> comparator, long quantity)
ctx - the hybris contextcomparator - the comparatorquantity - the quantity to consumeprotected static java.util.List<PromotionOrderEntryConsumed> doConsume(SessionContext ctx, java.util.List<PromotionOrderEntry> workingEntries, AbstractPromotion promotion, long quantity)
public java.util.List<PromotionOrderEntryConsumed> consume(SessionContext ctx, Product product, long quantity)
ctx - the hybris contextproduct - the product typequantity - the quantitypublic java.util.List<PromotionOrderEntry> getAllEntries(SessionContext ctx)
ctx - the hybris contextpublic java.util.List<PromotionOrderEntry> getAllEntriesByPrice(SessionContext ctx)
ctx - the hybris contextpublic PromotionOrderEntry peekFromHead(SessionContext ctx, java.util.Comparator<PromotionOrderEntry> comparator)
ctx - the hybris contextcomparator - the comparatorpublic PromotionOrderEntry peek(SessionContext ctx)
ctx - the hybris contextpublic PromotionOrderEntry peekFromTail(SessionContext ctx, java.util.Comparator<PromotionOrderEntry> comparator)
ctx - the hybris contextcomparator - the comparatorprotected static PromotionOrderEntry doPeek(SessionContext ctx, java.util.List<PromotionOrderEntry> workingEntries)
protected java.util.List<PromotionOrderEntry> getOrderEntries()
protected AbstractPromotion getPromotion()
Copyright © 2018 SAP SE. All Rights Reserved.