Class CandidateOrderOffer
java.lang.Object
com.broadleafcommerce.promotion.offer.service.dto.BaseCandidateOffer
com.broadleafcommerce.promotion.offer.service.dto.CandidateOrderOffer
- All Implemented Interfaces:
Serializable,Comparable<CandidateOrderOffer>
public class CandidateOrderOffer
extends BaseCandidateOffer
implements Comparable<CandidateOrderOffer>
DTO containing information necessary for determining if an
Offer that can apply to an
EnhancedOrder is part of the best permutation of all offers applicable to that order.- Author:
- Nathan Moore (nathanmoore).
- See Also:
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidprotected booleanintbooleanMap ofItemCriteriaRulefrom anoffer's item qualifier criteriato aCollectionofEnhancedLineItemthat meet that criteria.getOrder()The order being targeted byBaseCandidateOffer.getOffer()}.inthashCode()booleanWhether to round the offer discounts at the item level instead of the order level.voidsetCandidateQualifiersMap(Map<ItemCriteriaRule, Collection<EnhancedLineItem>> candidateQualifiersMap) Map ofItemCriteriaRulefrom anoffer's item qualifier criteriato aCollectionofEnhancedLineItemthat meet that criteria.voidsetOrder(EnhancedOrder order) The order being targeted byBaseCandidateOffer.getOffer()}.voidsetRoundDiscountsByItem(boolean roundDiscountsByItem) Whether to round the offer discounts at the item level instead of the order level.toString()Alternate implementation oftoStringthat does not include theorderto be used byOrderOfferAdjustmentin order to avoid infinite loop just from that context.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
-
CandidateOrderOffer
public CandidateOrderOffer()
-
-
Method Details
-
calculatePotentialSavings
public void calculatePotentialSavings() -
compareTo
- Specified by:
compareToin interfaceComparable<CandidateOrderOffer>
-
toStringWithoutOrder
Alternate implementation oftoStringthat does not include theorderto be used byOrderOfferAdjustmentin order to avoid infinite loop just from that context. -
getOrder
The order being targeted byBaseCandidateOffer.getOffer()}.- Returns:
- The order being targeted by
BaseCandidateOffer.getOffer().
-
getCandidateQualifiersMap
Map ofItemCriteriaRulefrom anoffer's item qualifier criteriato aCollectionofEnhancedLineItemthat meet that criteria.- Returns:
- Map of
ItemCriteriaRulefrom anoffer's item qualifier criteriato aCollectionofEnhancedLineItemthat meet that criteria.
-
isRoundDiscountsByItem
public boolean isRoundDiscountsByItem()Whether to round the offer discounts at the item level instead of the order level. -
setOrder
The order being targeted byBaseCandidateOffer.getOffer()}.- Parameters:
order- The order being targeted byBaseCandidateOffer.getOffer().
-
setCandidateQualifiersMap
public void setCandidateQualifiersMap(Map<ItemCriteriaRule, Collection<EnhancedLineItem>> candidateQualifiersMap) Map ofItemCriteriaRulefrom anoffer's item qualifier criteriato aCollectionofEnhancedLineItemthat meet that criteria.- Parameters:
candidateQualifiersMap- Map ofItemCriteriaRulefrom anoffer's item qualifier criteriato aCollectionofEnhancedLineItemthat meet that criteria.
-
setRoundDiscountsByItem
public void setRoundDiscountsByItem(boolean roundDiscountsByItem) Whether to round the offer discounts at the item level instead of the order level. -
equals
- Overrides:
equalsin classBaseCandidateOffer
-
canEqual
- Overrides:
canEqualin classBaseCandidateOffer
-
hashCode
public int hashCode()- Overrides:
hashCodein classBaseCandidateOffer
-
toString
- Overrides:
toStringin classBaseCandidateOffer
-