public class PromotionOrderResults extends 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,
List<PromotionResult> promotionResults,
double changeFromLastResults)
Constructor.
|
| Modifier and Type | Method and Description |
|---|---|
protected static List<WrappedOrderEntry> |
cleanWrappedEntryList(SessionContext ctx,
List<WrappedOrderEntry> wrappedEntries) |
protected static Collection<WrappedOrderEntry> |
findAllMatchingEntries(SessionContext ctx,
List<WrappedOrderEntry> wrappedEntries,
Collection<PromotionOrderEntryConsumed> consumedEntries) |
List<PromotionResult> |
getAllOrderPromotions()
Return a list of results for promotions that did not consume products.
|
List<PromotionResult> |
getAllProductPromotions()
Return a list of results for promotions that consumed products.
|
List<PromotionResult> |
getAllResults()
Returns all
PromotionResult objects. |
List<PromotionResult> |
getAppliedOrderPromotions()
Return a list of results for promotions that fired and did not consume products and have been applied.
|
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) |
List<WrappedOrderEntry> |
getEntriesNotInFiredPromotions()
Return a list of WrappedOrderEntry objects that were not part of any any promotion that fired.
|
List<WrappedOrderEntry> |
getEntriesNotInPromotions()
Return a list of WrappedOrderEntry objects that were not part of any any promotion that fired or could fire.
|
List<WrappedOrderEntry> |
getEntriesWithPotentialPromotions()
Return a list of WrappedOrderEntry objects that were part of any any promotion that could fire.
|
List<PromotionResult> |
getFiredOrderPromotions()
Return a list of results for promotions that fired and did not consume products.
|
List<PromotionResult> |
getFiredProductPromotions()
Return a list of results for promotions that fired and consumed products.
|
protected static long |
getMaxConsumedQuantityForEntry(SessionContext ctx,
List<PromotionResult> promotionResults,
AbstractOrderEntry orderEntry) |
List<PromotionResult> |
getPotentialOrderPromotions()
Return a list of results for promotions that fired and did not consume products and have been applied.
|
List<PromotionResult> |
getPotentialProductPromotions()
Return a list of results for promotions that fired and consumed products and have been applied.
|
protected 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,
List<WrappedOrderEntry> wrappedEntries,
Collection<PromotionOrderEntryConsumed> consumedEntries) |
protected static List<WrappedOrderEntry> |
wrapEntries(SessionContext ctx,
AbstractOrder order) |
public PromotionOrderResults(SessionContext ctx, AbstractOrder order, 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 List<PromotionResult> getAllResults()
PromotionResult objects. This list will include all promotions that either fired or identified
themselves as potentially firing.public List<PromotionResult> getAllProductPromotions()
public List<PromotionResult> getFiredProductPromotions()
public List<PromotionResult> getAppliedProductPromotions()
public List<PromotionResult> getPotentialProductPromotions()
public List<PromotionResult> getAllOrderPromotions()
public List<PromotionResult> getFiredOrderPromotions()
public List<PromotionResult> getAppliedOrderPromotions()
public List<PromotionResult> getPotentialOrderPromotions()
protected List<PromotionResult> getPromotionResults(PromotionOrderResults.PromotionResultStatus statusFlag, PromotionOrderResults.PromotionResultProducts productsFlag)
statusFlag - status criteriaproductsFlag - consumed products criteriapublic List<WrappedOrderEntry> getEntriesNotInPromotions()
public List<WrappedOrderEntry> getEntriesWithPotentialPromotions()
public 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, List<PromotionResult> promotionResults, AbstractOrderEntry orderEntry)
protected static long getConsumedQuantityForEntry(SessionContext ctx, PromotionResult result, AbstractOrderEntry orderEntry)
protected static Collection<WrappedOrderEntry> findAllMatchingEntries(SessionContext ctx, List<WrappedOrderEntry> wrappedEntries, Collection<PromotionOrderEntryConsumed> consumedEntries)
protected static List<WrappedOrderEntry> wrapEntries(SessionContext ctx, AbstractOrder order)
protected static void removeConsumedEntries(SessionContext ctx, List<WrappedOrderEntry> wrappedEntries, Collection<PromotionOrderEntryConsumed> consumedEntries)
protected static List<WrappedOrderEntry> cleanWrappedEntryList(SessionContext ctx, List<WrappedOrderEntry> wrappedEntries)
Copyright © 2017 SAP SE. All Rights Reserved.