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
-
Method Summary
Modifier and TypeMethodDescriptionvoid
addCompatibleOffers
(List<? extends BaseCandidateOffer> offers) Adds all offers of the same type that are compatible with this criteria to the compatibleOffers list.protected boolean
boolean
@NonNull OfferCombinabilityCriteriaKey
getKey()
int
hashCode()
boolean
isCompatibleWithOtherType
(CompatiblePermutationNode parentNode) void
setCompatibleOffers
(List<BaseCandidateOffer> compatibleOffers) void
setKey
(@NonNull OfferCombinabilityCriteriaKey key) void
setPermutations
(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
-