Class ItemOfferPermutationResult
java.lang.Object
com.broadleafcommerce.promotion.offer.service.dto.ItemOfferPermutationResult
DTO containing results of the evaluation of a permutation of item offers.
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionItemOfferPermutationResult
(ItemOfferPermutationResult result, OrderTotals initialTotals, String segmentToExclude) ItemOfferPermutationResult
(ItemOfferPermutationResult result, OrderTotals initialTotals, Set<LineItemOfferDetail> detailsToReset, com.broadleafcommerce.common.extension.TypeFactory offerFactory) Clone this ItemOfferPermutationResult and reset the passed in details to remove any adjustments.ItemOfferPermutationResult
(javax.money.CurrencyUnit currency) -
Method Summary
Modifier and TypeMethodDescriptionvoid
addFreeGiftItem
(com.broadleafcommerce.promotion.offer.client.web.context.info.FreeGiftItem freeGiftItem, javax.money.MonetaryAmount estimatedValue) buildAppliedItemOffersMap
(List<LineItemOfferDetail> details) protected Map<String,
List<LineItemOfferDetail>> buildItemOfferDetailMap
(List<LineItemOfferDetail> details) protected javax.money.MonetaryAmount
boolean
javax.money.CurrencyUnit
List<com.broadleafcommerce.promotion.offer.client.web.context.info.FreeGiftItem>
javax.money.MonetaryAmount
Gets the total adjustment value of thisItemOfferPermutationResult
, which is used to compare differentItemOfferPermutationResults
for combinability purposes.javax.money.MonetaryAmount
boolean
protected boolean
hasFreeTrial
(List<LineItemOfferDetail> itemDetails) boolean
boolean
boolean
void
populateItemDetailStructures
(List<LineItemOfferDetail> itemDetails) void
setCodeResponseMap
(Map<String, com.broadleafcommerce.promotion.offer.client.web.context.discounts.CodeResponse> codeResponseMap) void
setFreeTrialIncluded
(boolean freeTrialIncluded) void
setPermutationTotals
(OrderTotals permutationTotals) void
updateCodeResponse
(String code, com.broadleafcommerce.promotion.offer.client.web.context.discounts.CodeResponse response) void
updateCodesResponses
(Set<OfferCode> offerCodes, com.broadleafcommerce.promotion.offer.client.web.context.discounts.CodeResponse response)
-
Constructor Details
-
ItemOfferPermutationResult
public ItemOfferPermutationResult(javax.money.CurrencyUnit currency) -
ItemOfferPermutationResult
public ItemOfferPermutationResult(ItemOfferPermutationResult result, OrderTotals initialTotals, String segmentToExclude) -
ItemOfferPermutationResult
public ItemOfferPermutationResult(ItemOfferPermutationResult result, OrderTotals initialTotals, Set<LineItemOfferDetail> detailsToReset, com.broadleafcommerce.common.extension.TypeFactory offerFactory) Clone this ItemOfferPermutationResult and reset the passed in details to remove any adjustments.- Parameters:
result
-initialTotals
-detailsToReset
-
-
-
Method Details
-
populateItemDetailStructures
-
hasFreeTrial
-
containsDiscountsAcrossMultipleSegments
public boolean containsDiscountsAcrossMultipleSegments() -
getSegmentsWithAdjustmentsList
-
buildAppliedItemOffersMap
-
buildItemOfferDetailMap
protected Map<String,List<LineItemOfferDetail>> buildItemOfferDetailMap(List<LineItemOfferDetail> details) -
calculateTotalAdjustmentsValue
protected javax.money.MonetaryAmount calculateTotalAdjustmentsValue(List<LineItemOfferDetail> details) -
isLessValueThan
-
getTotalAdjustmentValue
public javax.money.MonetaryAmount getTotalAdjustmentValue()Gets the total adjustment value of thisItemOfferPermutationResult
, which is used to compare differentItemOfferPermutationResults
for combinability purposes. This overrides the default to also includetotalFreeGiftsValue
. -
isEqualTo
-
hasDetails
public boolean hasDetails() -
addFreeGiftItem
public void addFreeGiftItem(com.broadleafcommerce.promotion.offer.client.web.context.info.FreeGiftItem freeGiftItem, @Nonnull javax.money.MonetaryAmount estimatedValue) -
updateCodeResponse
public void updateCodeResponse(String code, com.broadleafcommerce.promotion.offer.client.web.context.discounts.CodeResponse response) -
updateCodesResponses
-
getPermutationTotals
-
getTotalFreeGiftsValue
public javax.money.MonetaryAmount getTotalFreeGiftsValue() -
getAppliedItemOffers
-
getCodeResponseMap
-
getLineItemDetails
-
getLineItemDetailMap
-
getFreeGiftItems
public List<com.broadleafcommerce.promotion.offer.client.web.context.info.FreeGiftItem> getFreeGiftItems() -
getCurrency
public javax.money.CurrencyUnit getCurrency() -
isFreeTrialIncluded
public boolean isFreeTrialIncluded() -
setPermutationTotals
-
setCodeResponseMap
-
setFreeTrialIncluded
public void setFreeTrialIncluded(boolean freeTrialIncluded)
-