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
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
protected boolean
int
boolean
Map ofItemCriteriaRule
from anoffer's item qualifier criteria
to aCollection
ofEnhancedLineItem
that meet that criteria.getOrder()
The order being targeted byBaseCandidateOffer.getOffer()
}.int
hashCode()
boolean
Whether to round the offer discounts at the item level instead of the order level.void
setCandidateQualifiersMap
(Map<ItemCriteriaRule, Collection<EnhancedLineItem>> candidateQualifiersMap) Map ofItemCriteriaRule
from anoffer's item qualifier criteria
to aCollection
ofEnhancedLineItem
that meet that criteria.void
setOrder
(EnhancedOrder order) The order being targeted byBaseCandidateOffer.getOffer()
}.void
setRoundDiscountsByItem
(boolean roundDiscountsByItem) Whether to round the offer discounts at the item level instead of the order level.toString()
Alternate implementation oftoString
that does not include theorder
to be used byOrderOfferAdjustment
in 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:
compareTo
in interfaceComparable<CandidateOrderOffer>
-
toStringWithoutOrder
Alternate implementation oftoString
that does not include theorder
to be used byOrderOfferAdjustment
in 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 ofItemCriteriaRule
from anoffer's item qualifier criteria
to aCollection
ofEnhancedLineItem
that meet that criteria.- Returns:
- Map of
ItemCriteriaRule
from anoffer's item qualifier criteria
to aCollection
ofEnhancedLineItem
that 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 ofItemCriteriaRule
from anoffer's item qualifier criteria
to aCollection
ofEnhancedLineItem
that meet that criteria.- Parameters:
candidateQualifiersMap
- Map ofItemCriteriaRule
from anoffer's item qualifier criteria
to aCollection
ofEnhancedLineItem
that 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:
equals
in classBaseCandidateOffer
-
canEqual
- Overrides:
canEqual
in classBaseCandidateOffer
-
hashCode
public int hashCode()- Overrides:
hashCode
in classBaseCandidateOffer
-
toString
- Overrides:
toString
in classBaseCandidateOffer
-