Class OfferCombinabilityCriteria
java.lang.Object
com.broadleafcommerce.promotion.offer.service.dto.OfferCombinabilityCriteria
- All Implemented Interfaces:
Serializable
This structure allows permutations by offer type to be grouped based on how they are combined
with other types and to easily check whether a given set of permutations is compatible with a
permutation from another offer type. For example, is a list of item offers compatible with a list
of fulfillment offers.
Taking this approach helps to reduce the combinatorial effect of considering every possible
combination across types since normally, even for large sets of offers, the offers fall into a
small set of similar combinability restrictions.
- Author:
- Brian Polster (bpolster)
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddCompatibleOffers(List<? extends BaseCandidateOffer> offers) Adds all offers of the same type that are compatible with this criteria to the compatibleOffers list.protected booleanboolean@NonNull OfferCombinabilityCriteriaKeygetKey()inthashCode()booleanisCompatibleWithOtherType(CompatiblePermutationNode parentNode) voidsetCompatibleOffers(List<BaseCandidateOffer> compatibleOffers) voidsetKey(@NonNull OfferCombinabilityCriteriaKey key) voidsetPermutations(Set<OffersPermutation> permutations) toString()
-
Constructor Details
-
OfferCombinabilityCriteria
-
-
Method Details
-
isCompatibleWithOtherType
-
addCompatibleOffers
Adds all offers of the same type that are compatible with this criteria to the compatibleOffers list.- Parameters:
offers- list of offers to add if compatible
-
getKey
-
getCompatibleOffers
-
getPermutations
-
setKey
-
setCompatibleOffers
-
setPermutations
-
equals
-
canEqual
-
hashCode
public int hashCode() -
toString
-