Class ProductPriceableTargetUtils
java.lang.Object
com.broadleafcommerce.datafeed.service.collector.product.support.ProductPriceableTargetUtils
-
Constructor Summary
ConstructorsConstructorDescriptionProductPriceableTargetUtils(com.broadleafcommerce.common.extension.TypeFactory typeFactory, CollectedProductJsonAccessorUtils collectedProductJsonAccessorUtils) -
Method Summary
Modifier and TypeMethodDescriptionprotected com.broadleafcommerce.pricing.client.domain.PriceableTargetcreateTargetForPricingKey(@NonNull CollectedProduct product, @NonNull Map<String, javax.money.MonetaryAmount> priceableFields) Creates thePriceableTargetfor aCollectedProductusing CollectedProduct's pricingKey asPriceableTarget.getTargetId().protected com.broadleafcommerce.pricing.client.domain.PriceableTargetcreateTargetForSku(@NonNull CollectedProduct product, @NonNull Map<String, javax.money.MonetaryAmount> priceableFields) Set<com.broadleafcommerce.pricing.client.domain.PriceableTarget>createTargets(@NonNull CollectedProduct product) CreatesPriceableTargetsfor aCollectedProduct.protected CollectedProductJsonAccessorUtilsgetPriceableFields(@NonNull CollectedProduct product) Builds the map of priceable fields for aCollectedProductthat 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) CreatesPriceableTargetsfor aCollectedProduct. This usually entails a target based on itsCollectedProduct.getId()and one on its SKU.- Parameters:
product-CollectedProductfor which to createPriceableTargets.- Returns:
PriceableTargetsfor aCollectedProduct.
-
getPriceableFields
protected Map<String,javax.money.MonetaryAmount> getPriceableFields(@NonNull @NonNull CollectedProduct product) Builds the map of priceable fields for aCollectedProductthat will be added asPriceableTarget.getPriceableFields(). The key is the type of the priceable field and the value is the amount.- Parameters:
product-CollectedProductfor 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-CollectedProductfor which to createPriceableTargets.priceableFields- Map of the priceable fields for the product to add asPriceableTarget.getPriceableFields().- Returns:
- the
PriceableTargetfor aCollectedProductusing 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 thePriceableTargetfor aCollectedProductusing CollectedProduct's pricingKey asPriceableTarget.getTargetId().- Parameters:
product-CollectedProductfor which to createPriceableTargets.priceableFields- Map of the priceable fields for the product to add asPriceableTarget.getPriceableFields().- Returns:
- the
PriceableTargetfor aCollectedProductusing CollectedProduct's pricingKey asPriceableTarget.getTargetId().
-
getTypeFactory
protected com.broadleafcommerce.common.extension.TypeFactory getTypeFactory() -
getCollectedProductJsonAccessorUtils
-