Class CandidateFulfillmentGroupOffer
java.lang.Object
com.broadleafcommerce.promotion.offer.service.dto.BaseCandidateOffer
com.broadleafcommerce.promotion.offer.service.dto.CandidateFulfillmentGroupOffer
- All Implemented Interfaces:
Serializable
DTO containing information necessary for determining if an
Offer that can apply to one or
more EnhancedFulfillmentGroups is part of the best permutation of all offers applicable
to that group.- Author:
- Nathan Moore (nathanmoore).
- See Also:
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected booleanprotected javax.money.MonetaryAmountcomputeDiscountedAmount(CandidateFulfillmentGroup candidateFulfillmentGroup) Computes the potential savings that can be applied for aCandidateFulfillmentGroup.booleanprotected javax.money.MonetaryAmountgetBaseTotal(CandidateFulfillmentGroup candidateFulfillmentGroup) Get the total cost of the provided fulfillment group before any adjustments are made.TheCandidateFulfillmentGroupsthat can be targeted byBaseCandidateOffer.offer, each one representing a decoratedEnhancedFulfillmentGroupwith savings information.protected javax.money.MonetaryAmountgetDiscountedAmount(CandidateFulfillmentGroup candidateFulfillmentGroup) The priority of theBaseCandidateOffer.offer.javax.money.MonetaryAmountTotal savings across allcandidateFulfillmentGroupsfor theBaseCandidateOffer.offer.inthashCode()voidincrementTotalSavings(javax.money.MonetaryAmount incrementAmount) voidPrice each of theCandidateFulfillmentGroupsaccording to theBaseCandidateOffer.offer.voidsetCandidateFulfillmentGroups(List<CandidateFulfillmentGroup> candidateFulfillmentGroups) TheCandidateFulfillmentGroupsthat can be targeted byBaseCandidateOffer.offer, each one representing a decoratedEnhancedFulfillmentGroupwith savings information.voidsetTotalSavings(javax.money.MonetaryAmount totalSavings) Total savings across allcandidateFulfillmentGroupsfor theBaseCandidateOffer.offer.voidSort theCandidateFulfillmentGroupsaccording to best discount.toString()Methods inherited from class com.broadleafcommerce.promotion.offer.service.dto.BaseCandidateOffer
calculateOverrideSegment, excludeDiscountedItemsFromTotal, getAllValidSegments, getCombinableOverrides, getCurrency, getDiscountAmount, getDiscountMethodType, getDiscountTargetType, getExcludedItemIds, getNonCombinableOverrides, getOffer, getOfferCodesMap, getOfferCombinabilityCriteriaKey, getOfferDtosMap, getOfferId, getOverrideOfferId, getPotentialSavings, getRoundingMode, getSegment, getStackableOverrides, initializeExcludedCartItemIds, isApplicableToDependentItems, isNotExcludedFromOffer, isRoundOfferValues, normalizeSegment, populateCombinabilityStructures, populateCombinabilityStructuresUsedBySameTargetType, populatePropertiesFromCodeData, segmentIsValid, setCombinableOverrides, setCurrency, setExcludedItemIds, setNonCombinableOverrides, setOffer, setOfferCodesMap, setOfferCombinabilityCriteriaKey, setOfferDtosMap, setOverrideOfferId, setPotentialSavings, setRoundingMode, setRoundOfferValues, setSegment, setStackableOverrides, updateAmountCurrency, updateMonetaryAmountCurrencyIfNeeded, updateOfferCombinabilityCriteria, validateCodesMatchOfferSegments
-
Field Details
-
ONE_HUNDRED
-
-
Constructor Details
-
CandidateFulfillmentGroupOffer
public CandidateFulfillmentGroupOffer()
-
-
Method Details
-
incrementTotalSavings
public void incrementTotalSavings(javax.money.MonetaryAmount incrementAmount) -
getPriority
The priority of theBaseCandidateOffer.offer.- Returns:
- The priority of the
BaseCandidateOffer.offer.
-
priceGroups
public void priceGroups()Price each of theCandidateFulfillmentGroupsaccording to theBaseCandidateOffer.offer. -
sortGroups
public void sortGroups()Sort theCandidateFulfillmentGroupsaccording to best discount. -
getBaseTotal
protected javax.money.MonetaryAmount getBaseTotal(CandidateFulfillmentGroup candidateFulfillmentGroup) Get the total cost of the provided fulfillment group before any adjustments are made.- Parameters:
candidateFulfillmentGroup- the fulfillment group to find the total cost for- Returns:
- the total cost of the fulfillment before adjustments
-
getDiscountedAmount
protected javax.money.MonetaryAmount getDiscountedAmount(CandidateFulfillmentGroup candidateFulfillmentGroup) -
computeDiscountedAmount
protected javax.money.MonetaryAmount computeDiscountedAmount(CandidateFulfillmentGroup candidateFulfillmentGroup) Computes the potential savings that can be applied for aCandidateFulfillmentGroup. The calculated amount is not finalized discount value, this only tells the group how much it can be discounted. SeeCandidateFulfillmentGroup.discountedAmount- Parameters:
candidateFulfillmentGroup- the fulfillment group to calculate potential discounts for- Returns:
- The monetary value of the total potential discounts
-
getCandidateFulfillmentGroups
TheCandidateFulfillmentGroupsthat can be targeted byBaseCandidateOffer.offer, each one representing a decoratedEnhancedFulfillmentGroupwith savings information.- Returns:
- The
EnhancedFulfillmentGroup(s) that can be targeted byBaseCandidateOffer.offer.
-
getTotalSavings
public javax.money.MonetaryAmount getTotalSavings()Total savings across allcandidateFulfillmentGroupsfor theBaseCandidateOffer.offer.- Returns:
- Total savings across all
candidateFulfillmentGroupsfor theBaseCandidateOffer.offer.
-
setCandidateFulfillmentGroups
public void setCandidateFulfillmentGroups(List<CandidateFulfillmentGroup> candidateFulfillmentGroups) TheCandidateFulfillmentGroupsthat can be targeted byBaseCandidateOffer.offer, each one representing a decoratedEnhancedFulfillmentGroupwith savings information.- Parameters:
candidateFulfillmentGroups- TheEnhancedFulfillmentGroup(s) that can be targeted byBaseCandidateOffer.offer.
-
setTotalSavings
public void setTotalSavings(javax.money.MonetaryAmount totalSavings) Total savings across allcandidateFulfillmentGroupsfor theBaseCandidateOffer.offer.- Parameters:
totalSavings- Total savings across allcandidateFulfillmentGroupsfor theBaseCandidateOffer.offer.
-
equals
- Overrides:
equalsin classBaseCandidateOffer
-
canEqual
- Overrides:
canEqualin classBaseCandidateOffer
-
hashCode
public int hashCode()- Overrides:
hashCodein classBaseCandidateOffer
-
toString
- Overrides:
toStringin classBaseCandidateOffer
-