Class OrderItemOfferUtils
- java.lang.Object
-
- com.broadleafcommerce.orderoperation.service.util.OrderItemOfferUtils
-
public class OrderItemOfferUtils extends Object
Utility class to aid in processingOrderItemsregarding offers.- Author:
- Sunny Yu
-
-
Constructor Summary
Constructors Constructor Description OrderItemOfferUtils(com.fasterxml.jackson.databind.ObjectMapper mapper, com.broadleafcommerce.common.extension.TypeFactory typeFactory)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected com.fasterxml.jackson.databind.ObjectMappergetMapper()List<com.broadleafcommerce.order.common.domain.OfferItemDetail>getQualifierOrderItemDetails(com.broadleafcommerce.order.client.domain.OrderItem item)Gets the offer qualifierOfferItemDetailsthat the givenOrderItemwas a target of.List<String>getQualifierOrderItemIds(com.broadleafcommerce.order.client.domain.OrderItem item)Retrieves the offer qualifierOrderItem.getId()from the given targetOrderItem.protected com.broadleafcommerce.common.extension.TypeFactorygetTypeFactory()booleanisFreeGiftItem(com.broadleafcommerce.order.client.domain.OrderItem item)Identifies if the givenOrderItemis a free gift item.
-
-
-
Method Detail
-
isFreeGiftItem
public boolean isFreeGiftItem(com.broadleafcommerce.order.client.domain.OrderItem item)
Identifies if the givenOrderItemis a free gift item.- Parameters:
item-OrderItemto check against- Returns:
- true if the given
OrderItemis 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 qualifierOfferItemDetailsthat the givenOrderItemwas a target of.- Parameters:
item- theOrderItemto get the offer qualifierOfferItemDetailsfrom- Returns:
- the offer qualifier
OfferItemDetailsthat the givenOrderItemwas a target of
-
getQualifierOrderItemIds
public List<String> getQualifierOrderItemIds(com.broadleafcommerce.order.client.domain.OrderItem item)
Retrieves the offer qualifierOrderItem.getId()from the given targetOrderItem.- Parameters:
item- theOrderItemto retrieve the targetOrderItem.getId()from- Returns:
- the target
OrderItem.getId()from the givenOrderItem
-
getMapper
protected com.fasterxml.jackson.databind.ObjectMapper getMapper()
-
getTypeFactory
protected com.broadleafcommerce.common.extension.TypeFactory getTypeFactory()
-
-