public class PromotionOrderResults
extends java.lang.Object
PromotionResult object represents the state of
any promotion that fired or potentially fired.| Modifier and Type | Class and Description |
|---|---|
protected static class |
PromotionOrderResults.PromotionResultProducts |
protected static class |
PromotionOrderResults.PromotionResultStatus |
| Constructor and Description |
|---|
PromotionOrderResults(SessionContext ctx,
AbstractOrder order,
java.util.List<PromotionResult> promotionResults,
double changeFromLastResults)
Constructor.
|
| Modifier and Type | Method and Description |
|---|---|
protected static java.util.List<WrappedOrderEntry> |
cleanWrappedEntryList(SessionContext ctx,
java.util.List<WrappedOrderEntry> wrappedEntries) |
protected static java.util.Collection<WrappedOrderEntry> |
findAllMatchingEntries(SessionContext ctx,
java.util.List<WrappedOrderEntry> wrappedEntries,
java.util.Collection<PromotionOrderEntryConsumed> consumedEntries) |
java.util.List<PromotionResult> |
getAllOrderPromotions()
Return a list of results for promotions that did not consume products.
|
java.util.List<PromotionResult> |
getAllProductPromotions()
Return a list of results for promotions that consumed products.
|
java.util.List<PromotionResult> |
getAllResults()
Returns all
PromotionResult objects. |
java.util.List<PromotionResult> |
getAppliedOrderPromotions()
Return a list of results for promotions that fired and did not consume products and have been applied.
|
java.util.List<PromotionResult> |
getAppliedProductPromotions()
Return a list of results for promotions that fired and consumed products and have been applied.
|
protected static long |
getConsumedQuantityForEntry(SessionContext ctx,
PromotionResult result,
AbstractOrderEntry orderEntry) |
java.util.List<WrappedOrderEntry> |
getEntriesNotInFiredPromotions()
Return a list of WrappedOrderEntry objects that were not part of any any promotion that fired.
|
java.util.List<WrappedOrderEntry> |
getEntriesNotInPromotions()
Return a list of WrappedOrderEntry objects that were not part of any any promotion that fired or could fire.
|
java.util.List<WrappedOrderEntry> |
getEntriesWithPotentialPromotions()
Return a list of WrappedOrderEntry objects that were part of any any promotion that could fire.
|
java.util.List<PromotionResult> |
getFiredOrderPromotions()
Return a list of results for promotions that fired and did not consume products.
|
java.util.List<PromotionResult> |
getFiredProductPromotions()
Return a list of results for promotions that fired and consumed products.
|
protected static long |
getMaxConsumedQuantityForEntry(SessionContext ctx,
java.util.List<PromotionResult> promotionResults,
AbstractOrderEntry orderEntry) |
java.util.List<PromotionResult> |
getPotentialOrderPromotions()
Return a list of results for promotions that fired and did not consume products and have been applied.
|
java.util.List<PromotionResult> |
getPotentialProductPromotions()
Return a list of results for promotions that fired and consumed products and have been applied.
|
protected java.util.List<PromotionResult> |
getPromotionResults(PromotionOrderResults.PromotionResultStatus statusFlag,
PromotionOrderResults.PromotionResultProducts productsFlag)
Return a list of results for promotions that meet the specified criteria.
|
double |
getTotalChangeFromLastResults()
Return the total change since the last evaluation of results.
|
void |
invalidateCache()
Invalidate all cached data held in this PromotionOrderResults instance.
|
protected static void |
removeConsumedEntries(SessionContext ctx,
java.util.List<WrappedOrderEntry> wrappedEntries,
java.util.Collection<PromotionOrderEntryConsumed> consumedEntries) |
protected static java.util.List<WrappedOrderEntry> |
wrapEntries(SessionContext ctx,
AbstractOrder order) |
public PromotionOrderResults(SessionContext ctx, AbstractOrder order, java.util.List<PromotionResult> promotionResults, double changeFromLastResults)
ctx - The hybris contextorder - The orderpromotionResults - The promotion resultschangeFromLastResults - The change from last resultspublic void invalidateCache()
public double getTotalChangeFromLastResults()
public java.util.List<PromotionResult> getAllResults()
PromotionResult objects. This list will include all promotions that either fired or identified
themselves as potentially firing.public java.util.List<PromotionResult> getAllProductPromotions()
public java.util.List<PromotionResult> getFiredProductPromotions()
public java.util.List<PromotionResult> getAppliedProductPromotions()
public java.util.List<PromotionResult> getPotentialProductPromotions()
public java.util.List<PromotionResult> getAllOrderPromotions()
public java.util.List<PromotionResult> getFiredOrderPromotions()
public java.util.List<PromotionResult> getAppliedOrderPromotions()
public java.util.List<PromotionResult> getPotentialOrderPromotions()
protected java.util.List<PromotionResult> getPromotionResults(PromotionOrderResults.PromotionResultStatus statusFlag, PromotionOrderResults.PromotionResultProducts productsFlag)
statusFlag - status criteriaproductsFlag - consumed products criteriapublic java.util.List<WrappedOrderEntry> getEntriesNotInPromotions()
public java.util.List<WrappedOrderEntry> getEntriesWithPotentialPromotions()
public java.util.List<WrappedOrderEntry> getEntriesNotInFiredPromotions()
getEntriesWithPotentialPromotions() and getEntriesNotInPromotions() but the WrappedOrderEntry
objects may be consolidated together.
In general it is preferable to call getEntriesWithPotentialPromotions() and
getEntriesNotInPromotions() that than calling this method directly.protected static long getMaxConsumedQuantityForEntry(SessionContext ctx, java.util.List<PromotionResult> promotionResults, AbstractOrderEntry orderEntry)
protected static long getConsumedQuantityForEntry(SessionContext ctx, PromotionResult result, AbstractOrderEntry orderEntry)
protected static java.util.Collection<WrappedOrderEntry> findAllMatchingEntries(SessionContext ctx, java.util.List<WrappedOrderEntry> wrappedEntries, java.util.Collection<PromotionOrderEntryConsumed> consumedEntries)
protected static java.util.List<WrappedOrderEntry> wrapEntries(SessionContext ctx, AbstractOrder order)
protected static void removeConsumedEntries(SessionContext ctx, java.util.List<WrappedOrderEntry> wrappedEntries, java.util.Collection<PromotionOrderEntryConsumed> consumedEntries)
protected static java.util.List<WrappedOrderEntry> cleanWrappedEntryList(SessionContext ctx, java.util.List<WrappedOrderEntry> wrappedEntries)
Copyright © 2018 SAP SE. All Rights Reserved.