public class CartItemPriceableTargetUtils extends Object
PriceableTargets
related to CartItem
.Constructor and Description |
---|
CartItemPriceableTargetUtils(com.fasterxml.jackson.databind.ObjectMapper mapper,
com.broadleafcommerce.common.extension.TypeFactory typeFactory) |
Modifier and Type | Method and Description |
---|---|
protected com.broadleafcommerce.pricing.client.domain.PriceableTarget |
createTarget(@NonNull String targetId,
@NonNull String targetType,
String vendorRef,
Integer quantity,
@NonNull Map<String,javax.money.MonetaryAmount> priceableFields)
Creates the
PriceableTarget with the specified identifier and type. |
protected com.broadleafcommerce.pricing.client.domain.PriceableTarget |
createTargetForSku(@NonNull String sku,
String vendorRef,
Integer quantity,
@NonNull Map<String,javax.money.MonetaryAmount> priceableFields)
Deprecated.
|
Set<com.broadleafcommerce.pricing.client.domain.PriceableTarget> |
createTargets(@NonNull com.broadleafcommerce.cart.client.domain.CartItem cartItem,
Map<String,Integer> totalQuantityForTargetId)
Creates
PriceableTargets for a CartItem . |
protected com.fasterxml.jackson.databind.ObjectMapper |
getMapper() |
protected Map<String,Map<String,javax.money.MonetaryAmount>> |
getPriceableFields(@NonNull com.broadleafcommerce.cart.client.domain.CartItem cartItem) |
protected Map<String,javax.money.MonetaryAmount> |
getPriceableFields(com.broadleafcommerce.pricing.client.domain.PriceInfo priceInfo)
Builds the map of priceable fields for a
PriceInfo that could later be added as
PriceableTarget.getPriceableFields() . |
protected Map<String,com.broadleafcommerce.pricing.client.domain.PriceInfo> |
getPriceInfos(@NonNull com.broadleafcommerce.cart.client.domain.CartItem cartItem) |
protected Map<String,com.broadleafcommerce.pricing.client.domain.PriceInfo> |
getSkuPriceInfos(@NonNull com.broadleafcommerce.cart.client.domain.CartItem cartItem)
Deprecated.
in favor of
getPriceInfos(CartItem) |
protected com.broadleafcommerce.common.extension.TypeFactory |
getTypeFactory() |
public CartItemPriceableTargetUtils(com.fasterxml.jackson.databind.ObjectMapper mapper, com.broadleafcommerce.common.extension.TypeFactory typeFactory)
public Set<com.broadleafcommerce.pricing.client.domain.PriceableTarget> createTargets(@NonNull @NonNull com.broadleafcommerce.cart.client.domain.CartItem cartItem, Map<String,Integer> totalQuantityForTargetId)
PriceableTargets
for a CartItem
. This will create as
many targets as are defined in the PRICEABLE_FIELDS
attribute in
CartItem.getInternalAttributes()
.cartItem
- CartItem
for which to create PriceableTargets
.PriceableTargets
for a CartItem
.protected Map<String,Map<String,javax.money.MonetaryAmount>> getPriceableFields(@NonNull @NonNull com.broadleafcommerce.cart.client.domain.CartItem cartItem)
@Deprecated protected Map<String,com.broadleafcommerce.pricing.client.domain.PriceInfo> getSkuPriceInfos(@NonNull @NonNull com.broadleafcommerce.cart.client.domain.CartItem cartItem)
getPriceInfos(CartItem)
protected Map<String,com.broadleafcommerce.pricing.client.domain.PriceInfo> getPriceInfos(@NonNull @NonNull com.broadleafcommerce.cart.client.domain.CartItem cartItem)
protected Map<String,javax.money.MonetaryAmount> getPriceableFields(@Nullable com.broadleafcommerce.pricing.client.domain.PriceInfo priceInfo)
PriceInfo
that could later be added as
PriceableTarget.getPriceableFields()
. The key is the type of the priceable field and
the value is the amount.priceInfo
- PriceInfo
for which to determine the priceable fields.PriceInfo
PricingFields
@Deprecated protected com.broadleafcommerce.pricing.client.domain.PriceableTarget createTargetForSku(@NonNull @NonNull String sku, @Nullable String vendorRef, Integer quantity, @NonNull @NonNull Map<String,javax.money.MonetaryAmount> priceableFields)
createTarget(String, String, String, Integer, Map)
PriceableTarget
with sku
as
PriceableTarget.getTargetId()
.sku
- SKU identifier for which to create a PriceableTarget
.vendorRef
- Soft reference to the vendor to be associated with this
PriceableTarget
.priceableFields
- Map of the priceable fields for the sku to add as
PriceableTarget.getPriceableFields()
.PriceableTarget
with sku
as
PriceableTarget.getTargetId()
.protected com.broadleafcommerce.pricing.client.domain.PriceableTarget createTarget(@NonNull @NonNull String targetId, @NonNull @NonNull String targetType, @Nullable String vendorRef, Integer quantity, @NonNull @NonNull Map<String,javax.money.MonetaryAmount> priceableFields)
PriceableTarget
with the specified identifier and type.targetId
- the target identifier for which to create a PriceableTarget
.targetType
- the target type for which to create a PriceableTarget
.vendorRef
- Soft reference to the vendor to be associated with this
PriceableTarget
.priceableFields
- Map of the priceable fields for the sku to add as
PriceableTarget.getPriceableFields()
.PriceableTarget
with sku
as
PriceableTarget.getTargetId()
.CartPricingTargetType
protected com.fasterxml.jackson.databind.ObjectMapper getMapper()
protected com.broadleafcommerce.common.extension.TypeFactory getTypeFactory()
Copyright © 2021. All rights reserved.