Class BLCPromotionMessageUtils
java.lang.Object
org.broadleafcommerce.core.promotionMessage.util.BLCPromotionMessageUtils
Convenience methods for interacting with
PromotionMessages- Author:
- Chris Kittrell (ckittrell)
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic List<PromotionMessageDTO>filterPromotionMessageDTOsByTypes(Map<String, List<PromotionMessageDTO>> promotionMessages, List<String> placementTypes) Given a map ofPromotionMessagePlacementTypes toPromotionMessageDTOs and a list ofPromotionMessagePlacementTypes, filter the map into a list.gatherMessages(List<PromotionMessage> promotionMessages) Given a list ofPromotionMessages, gather their message properties.gatherMessagesByPlacementType(Map<String, List<PromotionMessageDTO>> promotionMessageMap, PromotionMessagePlacementType type) Given a map ofPromotionMessagePlacementTypes toPromotionMessageDTOs, gather the message properties.gatherMessagesFromDTOs(List<PromotionMessageDTO> promotionMessages) Given a list ofPromotionMessageDTOs, gather their message properties.static voidsortMessagesByPriority(List<PromotionMessageDTO> promotionMessages) Given a list ofPromotionMessageDTOs, sort based on prioritystatic voidsortMessagesByPriority(Map<String, List<PromotionMessageDTO>> promotionMessages) Given a map ofPromotionMessagePlacementTypes toPromotionMessageDTOs, sort based on priority
-
Constructor Details
-
BLCPromotionMessageUtils
public BLCPromotionMessageUtils()
-
-
Method Details
-
gatherMessages
Given a list ofPromotionMessages, gather their message properties.- Parameters:
promotionMessages-- Returns:
- messages
-
gatherMessagesFromDTOs
Given a list ofPromotionMessageDTOs, gather their message properties.- Parameters:
promotionMessages-- Returns:
- messages
-
sortMessagesByPriority
Given a map ofPromotionMessagePlacementTypes toPromotionMessageDTOs, sort based on priority- Parameters:
promotionMessages-
-
sortMessagesByPriority
Given a list ofPromotionMessageDTOs, sort based on priority- Parameters:
promotionMessages-
-
gatherMessagesByPlacementType
public static List<String> gatherMessagesByPlacementType(Map<String, List<PromotionMessageDTO>> promotionMessageMap, PromotionMessagePlacementType type) Given a map ofPromotionMessagePlacementTypes toPromotionMessageDTOs, gather the message properties.- Parameters:
promotionMessageMap-type-- Returns:
- messages
-
filterPromotionMessageDTOsByTypes
public static List<PromotionMessageDTO> filterPromotionMessageDTOsByTypes(Map<String, List<PromotionMessageDTO>> promotionMessages, List<String> placementTypes) Given a map ofPromotionMessagePlacementTypes toPromotionMessageDTOs and a list ofPromotionMessagePlacementTypes, filter the map into a list.- Parameters:
promotionMessages-placementTypes-- Returns:
- a list of filtered message DTOs
-