org.broadleafcommerce.core.offer.service.discount.domain
Class PromotableOrderItemImpl

java.lang.Object
  extended by org.broadleafcommerce.core.offer.service.discount.domain.PromotableOrderItemImpl
All Implemented Interfaces:
PromotableOrderItem

public class PromotableOrderItemImpl
extends Object
implements PromotableOrderItem


Field Summary
protected  BigDecimal adjustmentPrice
           
protected  DiscreteOrderItem delegate
           
protected  PromotableItemFactory itemFactory
           
protected  PromotableOrder order
           
protected  List<PromotionDiscount> promotionDiscounts
           
protected  List<PromotionQualifier> promotionQualifiers
           
 
Constructor Summary
PromotableOrderItemImpl(DiscreteOrderItem orderItem, PromotableOrder order, PromotableItemFactory itemFactory)
           
 
Method Summary
 void addCandidateItemOffer(PromotableCandidateItemOffer candidateItemOffer)
           
 void addOrderItemAdjustment(PromotableOrderItemAdjustment orderItemAdjustment)
          Adds the adjustment to the order item's adjustment list and discounts the order item's adjustment price by the value of the adjustment.
 void addPromotionDiscount(PromotableCandidateItemOffer candidatePromotion, OfferItemCriteria itemCriteria, int quantity)
           
 void addPromotionQualifier(PromotableCandidateItemOffer candidatePromotion, OfferItemCriteria itemCriteria, int quantity)
           
 void assignFinalPrice()
           
 void clearAllDiscount()
           
 void clearAllNonFinalizedDiscounts()
           
 void clearAllNonFinalizedQualifiers()
           
 void clearAllNonFinalizedQuantities()
           
 void clearAllQualifiers()
           
 PromotableOrderItem clone()
           
 void computeAdjustmentPrice()
           
 void finalizeQuantities()
           
 Money getAdjustmentPrice()
           
 Money getCurrentPrice()
           
 DiscreteOrderItem getDelegate()
           
 Money getPriceBeforeAdjustments(boolean allowSalesPrice)
           
 int getPromotionDiscountMismatchQuantity()
           
 List<PromotionDiscount> getPromotionDiscounts()
           
 List<PromotionQualifier> getPromotionQualifiers()
           
 int getQuantity()
           
 int getQuantityAvailableToBeUsedAsQualifier(Offer promotion)
           
 int getQuantityAvailableToBeUsedAsTarget(Offer promotion)
           
 Money getRetailPrice()
           
 Money getSalePrice()
           
 Sku getSku()
           
 boolean isHasOrderItemAdjustments()
           
 boolean isNotCombinableOfferApplied()
           
 PromotionDiscount lookupOrCreatePromotionDiscount(PromotableCandidateItemOffer candidatePromotion)
           
 PromotionQualifier lookupOrCreatePromotionQualifier(PromotableCandidateItemOffer candidatePromotion)
           
 int removeAllAdjustments()
           
 void reset()
           
 void setAdjustmentPrice(Money adjustmentPrice)
           
 void setPromotionDiscounts(List<PromotionDiscount> promotionDiscounts)
           
 void setPromotionQualifiers(List<PromotionQualifier> promotionQualifiers)
           
 void setQuantity(int quantity)
           
 List<PromotableOrderItem> split()
           
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

adjustmentPrice

protected BigDecimal adjustmentPrice

promotionDiscounts

protected List<PromotionDiscount> promotionDiscounts

promotionQualifiers

protected List<PromotionQualifier> promotionQualifiers

delegate

protected DiscreteOrderItem delegate

order

protected PromotableOrder order

itemFactory

protected PromotableItemFactory itemFactory
Constructor Detail

PromotableOrderItemImpl

public PromotableOrderItemImpl(DiscreteOrderItem orderItem,
                               PromotableOrder order,
                               PromotableItemFactory itemFactory)
Method Detail

getDelegate

public DiscreteOrderItem getDelegate()
Specified by:
getDelegate in interface PromotableOrderItem

reset

public void reset()
Specified by:
reset in interface PromotableOrderItem

assignFinalPrice

public void assignFinalPrice()
Specified by:
assignFinalPrice in interface PromotableOrderItem

getCurrentPrice

public Money getCurrentPrice()
Specified by:
getCurrentPrice in interface PromotableOrderItem

computeAdjustmentPrice

public void computeAdjustmentPrice()
Specified by:
computeAdjustmentPrice in interface PromotableOrderItem

addOrderItemAdjustment

public void addOrderItemAdjustment(PromotableOrderItemAdjustment orderItemAdjustment)
Description copied from interface: PromotableOrderItem
Adds the adjustment to the order item's adjustment list and discounts the order item's adjustment price by the value of the adjustment.

Specified by:
addOrderItemAdjustment in interface PromotableOrderItem

removeAllAdjustments

public int removeAllAdjustments()
Specified by:
removeAllAdjustments in interface PromotableOrderItem

getAdjustmentPrice

public Money getAdjustmentPrice()
Specified by:
getAdjustmentPrice in interface PromotableOrderItem

setAdjustmentPrice

public void setAdjustmentPrice(Money adjustmentPrice)
Specified by:
setAdjustmentPrice in interface PromotableOrderItem

isNotCombinableOfferApplied

public boolean isNotCombinableOfferApplied()
Specified by:
isNotCombinableOfferApplied in interface PromotableOrderItem

isHasOrderItemAdjustments

public boolean isHasOrderItemAdjustments()
Specified by:
isHasOrderItemAdjustments in interface PromotableOrderItem

getPromotionDiscounts

public List<PromotionDiscount> getPromotionDiscounts()
Specified by:
getPromotionDiscounts in interface PromotableOrderItem

setPromotionDiscounts

public void setPromotionDiscounts(List<PromotionDiscount> promotionDiscounts)
Specified by:
setPromotionDiscounts in interface PromotableOrderItem

getPromotionQualifiers

public List<PromotionQualifier> getPromotionQualifiers()
Specified by:
getPromotionQualifiers in interface PromotableOrderItem

setPromotionQualifiers

public void setPromotionQualifiers(List<PromotionQualifier> promotionQualifiers)
Specified by:
setPromotionQualifiers in interface PromotableOrderItem

getQuantityAvailableToBeUsedAsQualifier

public int getQuantityAvailableToBeUsedAsQualifier(Offer promotion)
Specified by:
getQuantityAvailableToBeUsedAsQualifier in interface PromotableOrderItem

getQuantityAvailableToBeUsedAsTarget

public int getQuantityAvailableToBeUsedAsTarget(Offer promotion)
Specified by:
getQuantityAvailableToBeUsedAsTarget in interface PromotableOrderItem

addPromotionQualifier

public void addPromotionQualifier(PromotableCandidateItemOffer candidatePromotion,
                                  OfferItemCriteria itemCriteria,
                                  int quantity)
Specified by:
addPromotionQualifier in interface PromotableOrderItem

addPromotionDiscount

public void addPromotionDiscount(PromotableCandidateItemOffer candidatePromotion,
                                 OfferItemCriteria itemCriteria,
                                 int quantity)
Specified by:
addPromotionDiscount in interface PromotableOrderItem

lookupOrCreatePromotionQualifier

public PromotionQualifier lookupOrCreatePromotionQualifier(PromotableCandidateItemOffer candidatePromotion)
Specified by:
lookupOrCreatePromotionQualifier in interface PromotableOrderItem

lookupOrCreatePromotionDiscount

public PromotionDiscount lookupOrCreatePromotionDiscount(PromotableCandidateItemOffer candidatePromotion)
Specified by:
lookupOrCreatePromotionDiscount in interface PromotableOrderItem

clearAllNonFinalizedQuantities

public void clearAllNonFinalizedQuantities()
Specified by:
clearAllNonFinalizedQuantities in interface PromotableOrderItem

clearAllDiscount

public void clearAllDiscount()
Specified by:
clearAllDiscount in interface PromotableOrderItem

clearAllQualifiers

public void clearAllQualifiers()
Specified by:
clearAllQualifiers in interface PromotableOrderItem

clearAllNonFinalizedDiscounts

public void clearAllNonFinalizedDiscounts()
Specified by:
clearAllNonFinalizedDiscounts in interface PromotableOrderItem

clearAllNonFinalizedQualifiers

public void clearAllNonFinalizedQualifiers()
Specified by:
clearAllNonFinalizedQualifiers in interface PromotableOrderItem

finalizeQuantities

public void finalizeQuantities()
Specified by:
finalizeQuantities in interface PromotableOrderItem

getPromotionDiscountMismatchQuantity

public int getPromotionDiscountMismatchQuantity()
Specified by:
getPromotionDiscountMismatchQuantity in interface PromotableOrderItem

split

public List<PromotableOrderItem> split()
Specified by:
split in interface PromotableOrderItem

getQuantity

public int getQuantity()
Specified by:
getQuantity in interface PromotableOrderItem

setQuantity

public void setQuantity(int quantity)
Specified by:
setQuantity in interface PromotableOrderItem

getSku

public Sku getSku()
Specified by:
getSku in interface PromotableOrderItem

getPriceBeforeAdjustments

public Money getPriceBeforeAdjustments(boolean allowSalesPrice)
Specified by:
getPriceBeforeAdjustments in interface PromotableOrderItem

getSalePrice

public Money getSalePrice()
Specified by:
getSalePrice in interface PromotableOrderItem

getRetailPrice

public Money getRetailPrice()
Specified by:
getRetailPrice in interface PromotableOrderItem

addCandidateItemOffer

public void addCandidateItemOffer(PromotableCandidateItemOffer candidateItemOffer)
Specified by:
addCandidateItemOffer in interface PromotableOrderItem

clone

public PromotableOrderItem clone()
Specified by:
clone in interface PromotableOrderItem
Overrides:
clone in class Object


Copyright © 2012. All Rights Reserved.