Class OfferCombinabilityCriteria
- java.lang.Object
-
- com.broadleafcommerce.promotion.offer.service.dto.OfferCombinabilityCriteria
-
- All Implemented Interfaces:
Serializable
public class OfferCombinabilityCriteria extends Object implements 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:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description OfferCombinabilityCriteria(@NonNull OfferCombinabilityCriteriaKey key)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddCompatibleOffers(List<? extends BaseCandidateOffer> offers)Adds all offers of the same type that are compatible with this criteria to the compatibleOffers list.protected booleancanEqual(Object other)booleanequals(Object o)Set<BaseCandidateOffer>getCompatibleOffers()@NonNull OfferCombinabilityCriteriaKeygetKey()Set<OffersPermutation>getPermutations()inthashCode()booleanisCompatibleWithOtherType(CompatiblePermutationNode parentNode)voidsetCompatibleOffers(Set<BaseCandidateOffer> compatibleOffers)voidsetKey(@NonNull OfferCombinabilityCriteriaKey key)voidsetPermutations(Set<OffersPermutation> permutations)StringtoString()
-
-
-
Constructor Detail
-
OfferCombinabilityCriteria
public OfferCombinabilityCriteria(@NonNull @NonNull OfferCombinabilityCriteriaKey key)
-
-
Method Detail
-
isCompatibleWithOtherType
public boolean isCompatibleWithOtherType(CompatiblePermutationNode parentNode)
-
addCompatibleOffers
public void addCompatibleOffers(List<? extends BaseCandidateOffer> offers)
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
@NonNull public @NonNull OfferCombinabilityCriteriaKey getKey()
-
getCompatibleOffers
public Set<BaseCandidateOffer> getCompatibleOffers()
-
getPermutations
public Set<OffersPermutation> getPermutations()
-
setKey
public void setKey(@NonNull @NonNull OfferCombinabilityCriteriaKey key)
-
setCompatibleOffers
public void setCompatibleOffers(Set<BaseCandidateOffer> compatibleOffers)
-
setPermutations
public void setPermutations(Set<OffersPermutation> permutations)
-
canEqual
protected boolean canEqual(Object other)
-
-