Class OrderItemOfferUtils
java.lang.Object
com.broadleafcommerce.orderoperation.service.util.OrderItemOfferUtils
Utility class to aid in processing
OrderItems regarding offers.- Author:
- Sunny Yu
-
Constructor Summary
ConstructorsConstructorDescriptionOrderItemOfferUtils(com.fasterxml.jackson.databind.ObjectMapper mapper, com.broadleafcommerce.common.extension.TypeFactory typeFactory) -
Method Summary
Modifier and TypeMethodDescriptionprotected com.fasterxml.jackson.databind.ObjectMapperList<com.broadleafcommerce.order.common.domain.OfferItemDetail>getQualifierOrderItemDetails(com.broadleafcommerce.order.client.domain.OrderItem item) Gets the offer qualifierOfferItemDetailsthat the givenOrderItemwas a target of.getQualifierOrderItemIds(com.broadleafcommerce.order.client.domain.OrderItem item) Retrieves the offer qualifierOrderItem.getId()from the given targetOrderItem.protected com.broadleafcommerce.common.extension.TypeFactorybooleanisFreeGiftItem(com.broadleafcommerce.order.client.domain.OrderItem item) Identifies if the givenOrderItemis a free gift item.
-
Constructor Details
-
OrderItemOfferUtils
public OrderItemOfferUtils(com.fasterxml.jackson.databind.ObjectMapper mapper, com.broadleafcommerce.common.extension.TypeFactory typeFactory)
-
-
Method Details
-
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()
-