Class ProductPriceableTargetUtils
java.lang.Object
com.broadleafcommerce.datafeed.service.collector.product.support.ProductPriceableTargetUtils
-
Constructor Summary
ConstructorDescriptionProductPriceableTargetUtils
(com.broadleafcommerce.common.extension.TypeFactory typeFactory, CollectedProductJsonAccessorUtils collectedProductJsonAccessorUtils) -
Method Summary
Modifier and TypeMethodDescriptionprotected com.broadleafcommerce.pricing.client.domain.PriceableTarget
createTargetForPricingKey
(@NonNull CollectedProduct product, @NonNull Map<String, javax.money.MonetaryAmount> priceableFields) Creates thePriceableTarget
for aCollectedProduct
using CollectedProduct's pricingKey asPriceableTarget.getTargetId()
.protected com.broadleafcommerce.pricing.client.domain.PriceableTarget
createTargetForSku
(@NonNull CollectedProduct product, @NonNull Map<String, javax.money.MonetaryAmount> priceableFields) Set<com.broadleafcommerce.pricing.client.domain.PriceableTarget>
createTargets
(@NonNull CollectedProduct product) CreatesPriceableTargets
for aCollectedProduct
.protected CollectedProductJsonAccessorUtils
getPriceableFields
(@NonNull CollectedProduct product) Builds the map of priceable fields for aCollectedProduct
that will be added asPriceableTarget.getPriceableFields()
.protected com.broadleafcommerce.common.extension.TypeFactory
-
Constructor Details
-
ProductPriceableTargetUtils
public ProductPriceableTargetUtils(com.broadleafcommerce.common.extension.TypeFactory typeFactory, CollectedProductJsonAccessorUtils collectedProductJsonAccessorUtils)
-
-
Method Details
-
createTargets
public Set<com.broadleafcommerce.pricing.client.domain.PriceableTarget> createTargets(@NonNull @NonNull CollectedProduct product) CreatesPriceableTargets
for aCollectedProduct
. This usually entails a target based on itsCollectedProduct.getId()
and one on its SKU.- Parameters:
product
-CollectedProduct
for which to createPriceableTargets
.- Returns:
PriceableTargets
for aCollectedProduct
.
-
getPriceableFields
protected Map<String,javax.money.MonetaryAmount> getPriceableFields(@NonNull @NonNull CollectedProduct product) Builds the map of priceable fields for aCollectedProduct
that will be added asPriceableTarget.getPriceableFields()
. The key is the type of the priceable field and the value is the amount.- Parameters:
product
-CollectedProduct
for which to determine the priceable fields.- Returns:
- map of priceable fields for a
CollectedProduct
- See Also:
-
createTargetForSku
protected com.broadleafcommerce.pricing.client.domain.PriceableTarget createTargetForSku(@NonNull @NonNull CollectedProduct product, @NonNull @NonNull Map<String, javax.money.MonetaryAmount> priceableFields) - Parameters:
product
-CollectedProduct
for which to createPriceableTargets
.priceableFields
- Map of the priceable fields for the product to add asPriceableTarget.getPriceableFields()
.- Returns:
- the
PriceableTarget
for aCollectedProduct
using SKU asPriceableTarget.getTargetId()
.
-
createTargetForPricingKey
protected com.broadleafcommerce.pricing.client.domain.PriceableTarget createTargetForPricingKey(@NonNull @NonNull CollectedProduct product, @NonNull @NonNull Map<String, javax.money.MonetaryAmount> priceableFields) Creates thePriceableTarget
for aCollectedProduct
using CollectedProduct's pricingKey asPriceableTarget.getTargetId()
.- Parameters:
product
-CollectedProduct
for which to createPriceableTargets
.priceableFields
- Map of the priceable fields for the product to add asPriceableTarget.getPriceableFields()
.- Returns:
- the
PriceableTarget
for aCollectedProduct
using CollectedProduct's pricingKey asPriceableTarget.getTargetId()
.
-
getTypeFactory
protected com.broadleafcommerce.common.extension.TypeFactory getTypeFactory() -
getCollectedProductJsonAccessorUtils
-