Class VariantPriceableTargetUtils
java.lang.Object
com.broadleafcommerce.datafeed.service.collector.product.support.VariantPriceableTargetUtils
-
Constructor Summary
ConstructorDescriptionVariantPriceableTargetUtils
(com.broadleafcommerce.common.extension.TypeFactory typeFactory, CollectedProductJsonAccessorUtils collectedProductJsonAccessorUtils) -
Method Summary
Modifier and TypeMethodDescriptionprotected com.broadleafcommerce.pricing.client.domain.PriceableTarget
createTargetForProductPricingKey
(@NonNull VariantSummary variant, @NonNull CollectedProduct product, @NonNull Map<String, javax.money.MonetaryAmount> priceableFields) Creates thePriceableTarget
for aVariantSummary
using its owning product'sCollectedProduct's
pricingKey asPriceableTarget.getTargetId()
.protected com.broadleafcommerce.pricing.client.domain.PriceableTarget
createTargetForSku
(@NonNull VariantSummary variant, @NonNull Map<String, javax.money.MonetaryAmount> priceableFields) Creates thePriceableTarget
for aVariantSummary
usingVariantSummary.getSku()
asPriceableTarget.getTargetId()
.Set<com.broadleafcommerce.pricing.client.domain.PriceableTarget>
createTargets
(@NonNull VariantSummary variant, CollectedProduct product) CreatesPriceableTargets
for aVariantSummary
.protected CollectedProductJsonAccessorUtils
getPriceableFields
(@NonNull VariantSummary variant, CollectedProduct product) Builds the map of priceable fields for aVariantSummary
that 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) CreatesPriceableTargets
for aVariantSummary
. By default, this will just produce a single target based on itsVariantSummary.getSku()
.- Parameters:
variant
-VariantSummary
for which to createPriceableTargets
.- Returns:
PriceableTargets
for aVariantSummary
.
-
getPriceableFields
protected Map<String,javax.money.MonetaryAmount> getPriceableFields(@NonNull @NonNull VariantSummary variant, @Nullable CollectedProduct product) Builds the map of priceable fields for aVariantSummary
that will be added asPriceableTarget.getPriceableFields()
. The key is the type of the priceable field and the value is the amount.- Parameters:
variant
-VariantSummary
for 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 thePriceableTarget
for aVariantSummary
usingVariantSummary.getSku()
asPriceableTarget.getTargetId()
.- Parameters:
variant
-VariantSummary
for which to createPriceableTargets
.priceableFields
- Map of the priceable fields for the variant to add asPriceableTarget.getPriceableFields()
.- Returns:
- the
PriceableTarget
for aVariantSummary
usingVariantSummary.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 thePriceableTarget
for aVariantSummary
using its owning product'sCollectedProduct's
pricingKey asPriceableTarget.getTargetId()
.- Parameters:
variant
-VariantSummary
for which to createPriceableTargets
.product
-CollectedProduct
for which to get the pricingKey from.priceableFields
- Map of the priceable fields for the product to add asPriceableTarget.getPriceableFields()
.- Returns:
- the
PriceableTarget
for aVariantSummary
using its owning product'sCollectedProduct's
pricingKey asPriceableTarget.getTargetId()
.
-
getTypeFactory
protected com.broadleafcommerce.common.extension.TypeFactory getTypeFactory() -
getCollectedProductJsonAccessorUtils
-