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
ConstructorDescriptionOrderItemOfferUtils
(com.fasterxml.jackson.databind.ObjectMapper mapper, com.broadleafcommerce.common.extension.TypeFactory typeFactory) -
Method Summary
Modifier and TypeMethodDescriptionprotected com.fasterxml.jackson.databind.ObjectMapper
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.getQualifierOrderItemIds
(com.broadleafcommerce.order.client.domain.OrderItem item) Retrieves the offer qualifierOrderItem.getId()
from the given targetOrderItem
.protected com.broadleafcommerce.common.extension.TypeFactory
boolean
isFreeGiftItem
(com.broadleafcommerce.order.client.domain.OrderItem item) Identifies if the givenOrderItem
is 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 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()
-