Class PromotableOrderAdjustmentImpl
java.lang.Object
org.broadleafcommerce.core.offer.service.discount.domain.PromotableOrderAdjustmentImpl
- All Implemented Interfaces:
Serializable,PromotableOrderAdjustment
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected Moneyprotected booleanprotected Offerprotected PromotableCandidateOrderOfferprotected PromotableOrderprotected RoundingModeprotected intprotected boolean -
Constructor Summary
ConstructorsConstructorDescriptionPromotableOrderAdjustmentImpl(PromotableCandidateOrderOffer promotableCandidateOrderOffer, PromotableOrder promotableOrder) PromotableOrderAdjustmentImpl(PromotableCandidateOrderOffer promotableCandidateOrderOffer, PromotableOrder promotableOrder, Money adjustmentValue) -
Method Summary
Modifier and TypeMethodDescriptionprotected voidReturns the value of this adjustmentgetOffer()Returns the associated promotableCandidateOrderOfferReturns the associated promotableOrderintbooleanReturns true if this adjustment represents a combinable offer.booleanFuture credit means that the associated adjustment will be discounted at a later time to the customer via a credit.booleanIt is sometimes problematic to offer percentage-off offers with regards to rounding.booleanReturns true if this adjustment represents a totalitarian offer.voidsetFutureCredit(boolean futureCredit) Future credit means that the associated adjustment will be discounted at a later time to the customer via a credit.voidsetRoundingMode(RoundingMode roundingMode) voidsetRoundingScale(int roundingScale)
-
Field Details
-
promotableCandidateOrderOffer
-
promotableOrder
-
adjustmentValue
-
offer
-
roundOfferValues
protected boolean roundOfferValues -
roundingScale
protected int roundingScale -
roundingMode
-
isFutureCredit
protected boolean isFutureCredit
-
-
Constructor Details
-
PromotableOrderAdjustmentImpl
public PromotableOrderAdjustmentImpl(PromotableCandidateOrderOffer promotableCandidateOrderOffer, PromotableOrder promotableOrder) -
PromotableOrderAdjustmentImpl
public PromotableOrderAdjustmentImpl(PromotableCandidateOrderOffer promotableCandidateOrderOffer, PromotableOrder promotableOrder, Money adjustmentValue)
-
-
Method Details
-
getPromotableOrder
Description copied from interface:PromotableOrderAdjustmentReturns the associated promotableOrder- Specified by:
getPromotableOrderin interfacePromotableOrderAdjustment- Returns:
-
getOffer
Description copied from interface:PromotableOrderAdjustmentReturns the associated promotableCandidateOrderOffer- Specified by:
getOfferin interfacePromotableOrderAdjustment- Returns:
-
computeAdjustmentValue
protected void computeAdjustmentValue() -
getAdjustmentValue
Description copied from interface:PromotableOrderAdjustmentReturns the value of this adjustment- Specified by:
getAdjustmentValuein interfacePromotableOrderAdjustment- Returns:
-
isRoundOfferValues
public boolean isRoundOfferValues()It is sometimes problematic to offer percentage-off offers with regards to rounding. For example, consider an item that costs 9.99 and has a 50% promotion. To be precise, the offer value is 4.995, but this may be a strange value to display to the user depending on the currency being used. -
getRoundingScale
public int getRoundingScale() -
setRoundingScale
public void setRoundingScale(int roundingScale) - Parameters:
roundingScale-- See Also:
-
getRoundingMode
-
setRoundingMode
- Parameters:
roundingMode-- See Also:
-
isCombinable
public boolean isCombinable()Description copied from interface:PromotableOrderAdjustmentReturns true if this adjustment represents a combinable offer.- Specified by:
isCombinablein interfacePromotableOrderAdjustment
-
isTotalitarian
public boolean isTotalitarian()Description copied from interface:PromotableOrderAdjustmentReturns true if this adjustment represents a totalitarian offer.- Specified by:
isTotalitarianin interfacePromotableOrderAdjustment
-
isFutureCredit
public boolean isFutureCredit()Description copied from interface:PromotableOrderAdjustmentFuture credit means that the associated adjustment will be discounted at a later time to the customer via a credit. It is up to the implementor to decide how to achieve this. This field is used to determine if the adjustment originated from an offer marked as FUTURE_CREDIT.See
Offer.getAdjustmentType()for more info- Specified by:
isFutureCreditin interfacePromotableOrderAdjustment- Returns:
-
setFutureCredit
public void setFutureCredit(boolean futureCredit) Description copied from interface:PromotableOrderAdjustmentFuture credit means that the associated adjustment will be discounted at a later time to the customer via a credit. It is up to the implementor to decide how to achieve this. This field is used to determine if the adjustment originated from an offer marked as FUTURE_CREDIT.See
Offer.getAdjustmentType()for more info- Specified by:
setFutureCreditin interfacePromotableOrderAdjustment
-