Class CandidateOffers
- java.lang.Object
-
- com.broadleafcommerce.promotion.offer.service.dto.CandidateOffers
-
- All Implemented Interfaces:
Serializable
public class CandidateOffers extends Object implements Serializable
DTO containing the candidate offers broken out into groups based on anoffer'sDiscount.getTargetType()}.- Author:
- Nathan Moore (nathanmoore).
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description CandidateOffers()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected booleancanEqual(Object other)voiddistributeExclusions()In the admin, a user can specify an exclusion from either side of the offer.booleanequals(Object o)List<BaseCandidateOffer>getAllCandidateOffers()A set of all the relevant candidate offers for given offer engine executionSet<String>getAllOfferIds()Set of ids for all offers that are applicable to a given offer engine execution.List<CandidateFulfillmentGroupOffer>getCandidateFulfillmentGroupOffers()List of candidate offers targetingfulfillment groups.List<CandidateItemOffer>getCandidateFulfillmentItemOffers()List of candidate offers targetingfulfillment items.List<CandidateItemOffer>getCandidateOrderItemOffers()List of candidate offers targetingorder items.List<CandidateOrderOffer>getCandidateOrderOffers()List of candidate offers targetingorders.Map<String,Set<String>>getOtherTypeOfferIdsList()For combinability algorithms, it is helpful to know the ids of all other offer types.inthashCode()voidinitializeCandidateOfferForProcessing(BaseCandidateOffer offer)Adds the offer to the relevant collections used by the offer engine.booleanisEmpty()voidpopulateCombinabilityStructures()voidsetAllCandidateOffers(List<BaseCandidateOffer> allCandidateOffers)A set of all the relevant candidate offers for given offer engine executionvoidsetAllOfferIds(Set<String> allOfferIds)Set of ids for all offers that are applicable to a given offer engine execution.voidsetCandidateFulfillmentGroupOffers(List<CandidateFulfillmentGroupOffer> candidateFulfillmentGroupOffers)List of candidate offers targetingfulfillment groups.voidsetCandidateFulfillmentItemOffers(List<CandidateItemOffer> candidateFulfillmentItemOffers)List of candidate offers targetingfulfillment items.voidsetCandidateOrderItemOffers(List<CandidateItemOffer> candidateOrderItemOffers)List of candidate offers targetingorder items.voidsetCandidateOrderOffers(List<CandidateOrderOffer> candidateOrderOffers)List of candidate offers targetingorders.voidsetOtherTypeOfferIdsList(Map<String,Set<String>> otherTypeOfferIdsList)For combinability algorithms, it is helpful to know the ids of all other offer types.StringtoString()
-
-
-
Method Detail
-
initializeCandidateOfferForProcessing
public void initializeCandidateOfferForProcessing(BaseCandidateOffer offer)
Adds the offer to the relevant collections used by the offer engine.- Parameters:
offer-
-
populateCombinabilityStructures
public void populateCombinabilityStructures()
-
distributeExclusions
public void distributeExclusions()
In the admin, a user can specify an exclusion from either side of the offer. The offer engine needs to process the exclusions from either side. This method makes sure that if Offer A excludes B that Offer B also excludes A.
-
isEmpty
public boolean isEmpty()
-
getOtherTypeOfferIdsList
public Map<String,Set<String>> getOtherTypeOfferIdsList()
For combinability algorithms, it is helpful to know the ids of all other offer types. For example, an order offer needs to know the ids of all item and fulfillment offers to see which ones it can be combined with.
-
getAllOfferIds
public Set<String> getAllOfferIds()
Set of ids for all offers that are applicable to a given offer engine execution.
-
getAllCandidateOffers
public List<BaseCandidateOffer> getAllCandidateOffers()
A set of all the relevant candidate offers for given offer engine execution
-
getCandidateOrderItemOffers
public List<CandidateItemOffer> getCandidateOrderItemOffers()
List of candidate offers targetingorder items.- Returns:
- List of candidate offers targeting
order items. - See Also:
DiscountTargetType.ORDER_ITEM
-
getCandidateOrderOffers
public List<CandidateOrderOffer> getCandidateOrderOffers()
List of candidate offers targetingorders.- Returns:
- List of candidate offers targeting
orders. - See Also:
DiscountTargetType.ORDER
-
getCandidateFulfillmentGroupOffers
public List<CandidateFulfillmentGroupOffer> getCandidateFulfillmentGroupOffers()
List of candidate offers targetingfulfillment groups.- Returns:
- List of candidate offers targeting
fulfillment groups. - See Also:
DiscountTargetType.FULFILLMENT_GROUP
-
getCandidateFulfillmentItemOffers
public List<CandidateItemOffer> getCandidateFulfillmentItemOffers()
List of candidate offers targetingfulfillment items.- Returns:
- List of candidate offers targeting
fulfillment items. - See Also:
DiscountTargetType.FULFILLMENT_GROUP_ITEM
-
setOtherTypeOfferIdsList
public void setOtherTypeOfferIdsList(Map<String,Set<String>> otherTypeOfferIdsList)
For combinability algorithms, it is helpful to know the ids of all other offer types. For example, an order offer needs to know the ids of all item and fulfillment offers to see which ones it can be combined with.
-
setAllOfferIds
public void setAllOfferIds(Set<String> allOfferIds)
Set of ids for all offers that are applicable to a given offer engine execution.
-
setAllCandidateOffers
public void setAllCandidateOffers(List<BaseCandidateOffer> allCandidateOffers)
A set of all the relevant candidate offers for given offer engine execution
-
setCandidateOrderItemOffers
public void setCandidateOrderItemOffers(List<CandidateItemOffer> candidateOrderItemOffers)
List of candidate offers targetingorder items.- Parameters:
candidateOrderItemOffers- List of candidate offers targetingorder items.- See Also:
DiscountTargetType.ORDER_ITEM
-
setCandidateOrderOffers
public void setCandidateOrderOffers(List<CandidateOrderOffer> candidateOrderOffers)
List of candidate offers targetingorders.- Parameters:
candidateOrderOffers- List of candidate offers targetingorders.- See Also:
DiscountTargetType.ORDER
-
setCandidateFulfillmentGroupOffers
public void setCandidateFulfillmentGroupOffers(List<CandidateFulfillmentGroupOffer> candidateFulfillmentGroupOffers)
List of candidate offers targetingfulfillment groups.- Parameters:
candidateFulfillmentGroupOffers- List of candidate offers targetingfulfillment groups.- See Also:
DiscountTargetType.FULFILLMENT_GROUP
-
setCandidateFulfillmentItemOffers
public void setCandidateFulfillmentItemOffers(List<CandidateItemOffer> candidateFulfillmentItemOffers)
List of candidate offers targetingfulfillment items.- Parameters:
candidateFulfillmentItemOffers- List of candidate offers targetingfulfillment items.- See Also:
DiscountTargetType.FULFILLMENT_GROUP_ITEM
-
canEqual
protected boolean canEqual(Object other)
-
-