Class VariantPriceableTargetUtils
java.lang.Object
com.broadleafcommerce.datafeed.service.collector.product.support.VariantPriceableTargetUtils
-
Constructor Summary
ConstructorsConstructorDescriptionVariantPriceableTargetUtils(com.broadleafcommerce.common.extension.TypeFactory typeFactory, CollectedProductJsonAccessorUtils collectedProductJsonAccessorUtils) -
Method Summary
Modifier and TypeMethodDescriptionprotected com.broadleafcommerce.pricing.client.domain.PriceableTargetcreateTargetForProductPricingKey(@NonNull VariantSummary variant, @NonNull CollectedProduct product, @NonNull Map<String, javax.money.MonetaryAmount> priceableFields) Creates thePriceableTargetfor aVariantSummaryusing its owning product'sCollectedProduct'spricingKey asPriceableTarget.getTargetId().protected com.broadleafcommerce.pricing.client.domain.PriceableTargetcreateTargetForSku(@NonNull VariantSummary variant, @NonNull Map<String, javax.money.MonetaryAmount> priceableFields) Creates thePriceableTargetfor aVariantSummaryusingVariantSummary.getSku()asPriceableTarget.getTargetId().Set<com.broadleafcommerce.pricing.client.domain.PriceableTarget>createTargets(@NonNull VariantSummary variant, CollectedProduct product) CreatesPriceableTargetsfor aVariantSummary.protected CollectedProductJsonAccessorUtilsgetPriceableFields(@NonNull VariantSummary variant, CollectedProduct product) Builds the map of priceable fields for aVariantSummarythat will be added asPriceableTarget.getPriceableFields().protected com.broadleafcommerce.common.extension.TypeFactory
-
Constructor Details
-
VariantPriceableTargetUtils
public VariantPriceableTargetUtils(com.broadleafcommerce.common.extension.TypeFactory typeFactory, CollectedProductJsonAccessorUtils collectedProductJsonAccessorUtils)
-
-
Method Details
-
createTargets
public Set<com.broadleafcommerce.pricing.client.domain.PriceableTarget> createTargets(@NonNull @NonNull VariantSummary variant, @Nullable CollectedProduct product) CreatesPriceableTargetsfor aVariantSummary. By default, this will just produce a single target based on itsVariantSummary.getSku().- Parameters:
variant-VariantSummaryfor which to createPriceableTargets.- Returns:
PriceableTargetsfor aVariantSummary.
-
getPriceableFields
protected Map<String,javax.money.MonetaryAmount> getPriceableFields(@NonNull @NonNull VariantSummary variant, @Nullable CollectedProduct product) Builds the map of priceable fields for aVariantSummarythat will be added asPriceableTarget.getPriceableFields(). The key is the type of the priceable field and the value is the amount.- Parameters:
variant-VariantSummaryfor which to determine the priceable fields.- Returns:
- map of priceable fields for a
VariantSummary - See Also:
-
createTargetForSku
protected com.broadleafcommerce.pricing.client.domain.PriceableTarget createTargetForSku(@NonNull @NonNull VariantSummary variant, @NonNull @NonNull Map<String, javax.money.MonetaryAmount> priceableFields) Creates thePriceableTargetfor aVariantSummaryusingVariantSummary.getSku()asPriceableTarget.getTargetId().- Parameters:
variant-VariantSummaryfor which to createPriceableTargets.priceableFields- Map of the priceable fields for the variant to add asPriceableTarget.getPriceableFields().- Returns:
- the
PriceableTargetfor aVariantSummaryusingVariantSummary.getSku()asPriceableTarget.getTargetId().
-
createTargetForProductPricingKey
protected com.broadleafcommerce.pricing.client.domain.PriceableTarget createTargetForProductPricingKey(@NonNull @NonNull VariantSummary variant, @NonNull @NonNull CollectedProduct product, @NonNull @NonNull Map<String, javax.money.MonetaryAmount> priceableFields) Creates thePriceableTargetfor aVariantSummaryusing its owning product'sCollectedProduct'spricingKey asPriceableTarget.getTargetId().- Parameters:
variant-VariantSummaryfor which to createPriceableTargets.product-CollectedProductfor which to get the pricingKey from.priceableFields- Map of the priceable fields for the product to add asPriceableTarget.getPriceableFields().- Returns:
- the
PriceableTargetfor aVariantSummaryusing its owning product'sCollectedProduct'spricingKey asPriceableTarget.getTargetId().
-
getTypeFactory
protected com.broadleafcommerce.common.extension.TypeFactory getTypeFactory() -
getCollectedProductJsonAccessorUtils
-