Class OrderItemOfferUtils


  • public class OrderItemOfferUtils
    extends Object
    Utility class to aid in processing OrderItems regarding offers.
    Author:
    Sunny Yu
    • Constructor Detail

      • OrderItemOfferUtils

        public OrderItemOfferUtils​(com.fasterxml.jackson.databind.ObjectMapper mapper,
                                   com.broadleafcommerce.common.extension.TypeFactory typeFactory)
    • Method Detail

      • isFreeGiftItem

        public boolean isFreeGiftItem​(com.broadleafcommerce.order.client.domain.OrderItem item)
        Identifies if the given OrderItem is a free gift item.
        Parameters:
        item - OrderItem to check against
        Returns:
        true if the given OrderItem is a free gift item, otherwise false
      • getQualifierOrderItemDetails

        public List<com.broadleafcommerce.order.common.domain.OfferItemDetail> getQualifierOrderItemDetails​(com.broadleafcommerce.order.client.domain.OrderItem item)
        Gets the offer qualifier OfferItemDetails that the given OrderItem was a target of.
        Parameters:
        item - the OrderItem to get the offer qualifier OfferItemDetails from
        Returns:
        the offer qualifier OfferItemDetails that the given OrderItem was a target of
      • getQualifierOrderItemIds

        public List<String> getQualifierOrderItemIds​(com.broadleafcommerce.order.client.domain.OrderItem item)
        Retrieves the offer qualifier OrderItem.getId() from the given target OrderItem.
        Parameters:
        item - the OrderItem to retrieve the target OrderItem.getId() from
        Returns:
        the target OrderItem.getId() from the given OrderItem
      • getMapper

        protected com.fasterxml.jackson.databind.ObjectMapper getMapper()
      • getTypeFactory

        protected com.broadleafcommerce.common.extension.TypeFactory getTypeFactory()