Class WrappedOrderEntry
java.lang.Object
de.hybris.platform.promotions.result.WrappedOrderEntry
WrappedOrderEntry. A decorated presentation of OrderEntry which attaches extra information about whether the entry
was part of any promotions.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprotected static classComparator forPromotionResultthat compares by certainty and then by priority. -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedWrappedOrderEntry(SessionContext ctx, AbstractOrderEntry orderEntry) protectedWrappedOrderEntry(SessionContext ctx, AbstractOrderEntry orderEntry, long quantity) protectedWrappedOrderEntry(SessionContext ctx, AbstractOrderEntry orderEntry, long quantity, Collection<PromotionResult> promotionResults) -
Method Summary
Modifier and TypeMethodDescriptionprotected voidaddPromotionResult(SessionContext ctx, PromotionResult promotionResult) Add a promotion result to this wrapped order entry.protected voidaddPromotionResults(SessionContext ctx, Collection<PromotionResult> promotionResults) Add a multiple promotion results to this wrapped order entry.protected voidconsume(long quantity) Protected method to allow order entries to be adjusted by consuming quantities.protected booleanThe product in this order entry.doubleGet the total price for this order entry (unit price * quantity).doubleGet the total price for this order entry (unit price * quantity).The product in this order entry.getProduct(SessionContext ctx) The product in this order entry.The list ofPromotionResultobjects that applied to this order entry.longThe quantity of the order entry.longThe quantity of the order entry.getUnit()Get the unit for this entry.getUnit(SessionContext ctx) Get the unit for this entry.doubleGet the price for one unit of the represented product.doubleReturns the price for one unit of the represented product.protected booleanReturns false if the Promotion of the Promotion Result is/extends one from promotionengineservices.
-
Constructor Details
-
WrappedOrderEntry
-
WrappedOrderEntry
-
WrappedOrderEntry
protected WrappedOrderEntry(SessionContext ctx, AbstractOrderEntry orderEntry, long quantity, Collection<PromotionResult> promotionResults)
-
-
Method Details
-
getQuantity
public long getQuantity()The quantity of the order entry.- Returns:
- The quantity
-
getQuantity
The quantity of the order entry.- Parameters:
ctx- The hybris session context- Returns:
- The quantity
-
getProduct
The product in this order entry.- Returns:
- The product in this order entry
-
getProduct
The product in this order entry.- Parameters:
ctx- The hybris session context- Returns:
- The product in this order entry
-
getBaseOrderEntry
The product in this order entry.- Returns:
- The product in this order entry
-
getPromotionResults
The list ofPromotionResultobjects that applied to this order entry.- Returns:
- A list of
PromotionResultobjects
-
addPromotionResult
Add a promotion result to this wrapped order entry.- Parameters:
ctx- The hybris session contextpromotionResult- The promotion result to add
-
addPromotionResults
protected void addPromotionResults(SessionContext ctx, Collection<PromotionResult> promotionResults) Add a multiple promotion results to this wrapped order entry.- Parameters:
ctx- The hybris session contextpromotionResults- The promotion results to add
-
consume
protected void consume(long quantity) Protected method to allow order entries to be adjusted by consuming quantities.- Parameters:
quantity- The quantity to consume
-
getEntryPrice
public double getEntryPrice()Get the total price for this order entry (unit price * quantity).- Returns:
- The total price
-
getEntryPrice
Get the total price for this order entry (unit price * quantity).- Parameters:
ctx- The hybris session context- Returns:
- The total price
-
getUnitPrice
public double getUnitPrice()Get the price for one unit of the represented product.- Returns:
- The unit price
-
getUnitPrice
Returns the price for one unit of the represented product.- Parameters:
ctx- The hybris session context- Returns:
- The unit price
-
getUnit
Get the unit for this entry.- Returns:
- The unit
-
getUnit
Get the unit for this entry.- Parameters:
ctx- The hybris session context- Returns:
- The unit
-
consumePromotionOrderEntryConsumed
protected boolean consumePromotionOrderEntryConsumed(SessionContext ctx, PromotionOrderEntryConsumed poec) -
isLegacyPromotion
Returns false if the Promotion of the Promotion Result is/extends one from promotionengineservices. True otherwise.
-