Class OrderItemOfferUtils
- java.lang.Object
-
- com.broadleafcommerce.orderoperation.service.util.OrderItemOfferUtils
-
public class OrderItemOfferUtils extends Object
Utility class to aid in processingOrderItems
regarding 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.ObjectMapper
getMapper()
List<com.broadleafcommerce.order.common.domain.OfferItemDetail>
getQualifierOrderItemDetails(com.broadleafcommerce.order.client.domain.OrderItem item)
Gets the offer qualifierOfferItemDetails
that the givenOrderItem
was 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.TypeFactory
getTypeFactory()
boolean
isFreeGiftItem(com.broadleafcommerce.order.client.domain.OrderItem item)
Identifies if the givenOrderItem
is a free gift item.
-
-
-
Method Detail
-
isFreeGiftItem
public boolean isFreeGiftItem(com.broadleafcommerce.order.client.domain.OrderItem item)
Identifies if the givenOrderItem
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 qualifierOfferItemDetails
that the givenOrderItem
was a target of.- Parameters:
item
- theOrderItem
to get the offer qualifierOfferItemDetails
from- Returns:
- the offer qualifier
OfferItemDetails
that the givenOrderItem
was 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
- theOrderItem
to 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()
-
-