Class ProductPriceableTargetUtils

java.lang.Object
com.broadleafcommerce.datafeed.service.collector.product.support.ProductPriceableTargetUtils

public class ProductPriceableTargetUtils extends Object
  • 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)
      Creates PriceableTargets for a CollectedProduct. This usually entails a target based on its CollectedProduct.getId() and one on its SKU.
      Parameters:
      product - CollectedProduct for which to create PriceableTargets.
      Returns:
      PriceableTargets for a CollectedProduct.
    • getPriceableFields

      protected Map<String,javax.money.MonetaryAmount> getPriceableFields(@NonNull @NonNull CollectedProduct product)
      Builds the map of priceable fields for a CollectedProduct that will be added as PriceableTarget.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)
      Creates the PriceableTarget for a CollectedProduct using SKU as PriceableTarget.getTargetId().
      Parameters:
      product - CollectedProduct for which to create PriceableTargets.
      priceableFields - Map of the priceable fields for the product to add as PriceableTarget.getPriceableFields().
      Returns:
      the PriceableTarget for a CollectedProduct using SKU as PriceableTarget.getTargetId().
    • createTargetForPricingKey

      protected com.broadleafcommerce.pricing.client.domain.PriceableTarget createTargetForPricingKey(@NonNull @NonNull CollectedProduct product, @NonNull @NonNull Map<String,javax.money.MonetaryAmount> priceableFields)
      Creates the PriceableTarget for a CollectedProduct using CollectedProduct's pricingKey as PriceableTarget.getTargetId().
      Parameters:
      product - CollectedProduct for which to create PriceableTargets.
      priceableFields - Map of the priceable fields for the product to add as PriceableTarget.getPriceableFields().
      Returns:
      the PriceableTarget for a CollectedProduct using CollectedProduct's pricingKey as PriceableTarget.getTargetId().
    • getTypeFactory

      protected com.broadleafcommerce.common.extension.TypeFactory getTypeFactory()
    • getCollectedProductJsonAccessorUtils

      protected CollectedProductJsonAccessorUtils getCollectedProductJsonAccessorUtils()