Class PriceableTargetPriceState

java.lang.Object
com.broadleafcommerce.pricing.service.state.PriceableTargetPriceState

public class PriceableTargetPriceState extends Object

Used to contain useful information while gathering prices for a list of PriceableTargets.

Contains:

  1. Mappings between a price for a PriceableTarget and the PriceList the provided that price for use in creating PriceDetails for PriceInfos. See stdPriceDetailByPriceListPrice, salePriceDetailByPriceListPrice, contractPriceDetailByPriceListPrice.
  2. Mapping between a PriceableTarget prices and the name of the price, e.g., standardPrice, salePrice, and contractPrice. See prices
  3. Mapping between PriceLists and the PriceLists they represent. This can be useful for fetching all first-level price lists at once rather than piece-meal. See priceListIdPriceListMap
  4. Mapping between PriceLists and PriceableTargets to the PriceData matching them. See priceListAndTargetPriceDataMap
  5. Set of all price list types. See priceListTypes.

Author:
Nathan Moore (nathanmoore).
  • Constructor Details

    • PriceableTargetPriceState

      public PriceableTargetPriceState()
  • Method Details

    • withPriceListTypes

      @Deprecated(forRemoval=true, since="2.2.0") public PriceableTargetPriceState withPriceListTypes(List<String> priceListTypes)
      Deprecated, for removal: This API element is subject to removal in a future version.
    • withPriceListIdPriceListMap

      public PriceableTargetPriceState withPriceListIdPriceListMap(Map<String,PriceList> priceListIdPriceListMap)
    • withPriceListAndTargetPriceDataMap

      public PriceableTargetPriceState withPriceListAndTargetPriceDataMap(Map<org.apache.commons.lang3.tuple.Pair<String,TargetKeyDto>,List<PriceData>> priceListAndTargetPriceDataMap)
    • withPriceInfoContext

      public PriceableTargetPriceState withPriceInfoContext(com.broadleafcommerce.pricing.client.domain.context.PriceInfoContext priceInfoContext)
    • getCompositePriceListPriceMap

      @Deprecated(forRemoval=true, since="1.7.14, 2.0.1") public Map<PriceList,javax.money.MonetaryAmount> getCompositePriceListPriceMap()
      Deprecated, for removal: This API element is subject to removal in a future version.
    • getCompositePriceListPriceDetailMap

      public Map<PriceList,PriceListPriceDetail> getCompositePriceListPriceDetailMap()
      Composite of all price list price maps
    • putOtherPriceListPriceMaps

      @Deprecated(forRemoval=true, since="1.7.14, 2.0.1") protected void putOtherPriceListPriceMaps(Map<PriceList,javax.money.MonetaryAmount> composite)
      Deprecated, for removal: This API element is subject to removal in a future version.
    • putOtherPriceListPriceDetailMaps

      protected void putOtherPriceListPriceDetailMaps(Map<PriceList,PriceListPriceDetail> composite)
      Extension point for additional price list types
    • getPriceListPriceMappingForType

      @Deprecated(forRemoval=true, since="1.7.14, 2.0.1") public Map<PriceList,javax.money.MonetaryAmount> getPriceListPriceMappingForType(String type)
      Deprecated, for removal: This API element is subject to removal in a future version.
    • getPriceListPriceDetailMappingForType

      public Map<PriceList,PriceListPriceDetail> getPriceListPriceDetailMappingForType(String type)
      Gets the price list price mapping for the price list type
    • getOtherPriceListPriceMapping

      @Deprecated(forRemoval=true, since="1.7.14, 2.0.1") protected Map<PriceList,javax.money.MonetaryAmount> getOtherPriceListPriceMapping(String type)
      Deprecated, for removal: This API element is subject to removal in a future version.
    • getOtherPriceListPriceDetailMapping

      protected Map<PriceList,PriceListPriceDetail> getOtherPriceListPriceDetailMapping(String type)
      Extension point for additional price list types
    • putPriceListPriceDetailMapping

      public void putPriceListPriceDetailMapping(PriceList priceList, PriceListPriceDetail priceListPriceDetail)
      Put a price list price mapping. This will automatically resolve the correct price list type.
    • getRequestedCurrency

      @Nullable public javax.money.CurrencyUnit getRequestedCurrency()
      Gets the currency that was requested for the current pricing context.
      Since:
      Pricing Services 2.2.0, Release Train 2.3.0
    • getStdPriceListPriceMap

      @Deprecated public Map<PriceList,javax.money.MonetaryAmount> getStdPriceListPriceMap()
      Deprecated.
      in favor of stdPriceDetailByPriceListPrice
    • getSalePriceListPriceMap

      @Deprecated public Map<PriceList,javax.money.MonetaryAmount> getSalePriceListPriceMap()
      Deprecated.
      in favor of salePriceDetailByPriceListPrice
    • getContractPriceListPriceMap

      @Deprecated public Map<PriceList,javax.money.MonetaryAmount> getContractPriceListPriceMap()
      Deprecated.
      in favor of contractPriceDetailByPriceListPrice
    • getStdPriceDetailByPriceListPrice

      public Map<PriceList,PriceListPriceDetail> getStdPriceDetailByPriceListPrice()
      Since:
      1.7.14, 2.0.1
    • getSalePriceDetailByPriceListPrice

      public Map<PriceList,PriceListPriceDetail> getSalePriceDetailByPriceListPrice()
      Since:
      1.7.14, 2.0.1
    • getContractPriceDetailByPriceListPrice

      public Map<PriceList,PriceListPriceDetail> getContractPriceDetailByPriceListPrice()
      Since:
      1.7.14, 2.0.1
    • getPrices

      public Map<String,com.broadleafcommerce.pricing.client.domain.PriceDetail> getPrices()
      Map of price type (e.g., standardPrice, salePrice, contractPrice) to the PriceDetail of the "best" price for that type.
    • getBackupPrices

      public Map<String,com.broadleafcommerce.pricing.client.domain.PriceDetail> getBackupPrices()
      Map of price type (e.g., standardPrice, salePrice, contractPrice) to the PriceDetail of the "best" backup price for that type. Backup prices are returned when the preferred price represents a limited quantity price. This allows the caller to show prices for quantities above the limited threshold.
    • getPriceListTypes

      @Deprecated public List<String> getPriceListTypes()
      Deprecated.
      unused
    • getPriceTiers

      public Map<String,List<PriceDataTier>> getPriceTiers()
    • getPriceListIdPriceListMap

      public Map<String,PriceList> getPriceListIdPriceListMap()
      All first-level price lists mapped to the price lists they represent. First-level means that we aren't traversing the price list hierarchy to fetch the whole tree. That can be done as needed.
    • getPriceListAndTargetPriceDataMap

      public Map<org.apache.commons.lang3.tuple.Pair<String,TargetKeyDto>,List<PriceData>> getPriceListAndTargetPriceDataMap()
      All first-level price lists mapped to the price data they aggregate. First-level means that we aren't traversing the price list hierarchy to fetch the whole tree. That can be done as needed.
    • getPriceInfoContext

      @Nullable public com.broadleafcommerce.pricing.client.domain.context.PriceInfoContext getPriceInfoContext()
      The PriceInfoContext for the current pricing flow.
      Since:
      Pricing Services 2.2.0, Release Train 2.3.0
    • getCostPriceData

      public Optional<PriceData> getCostPriceData()
      If a COST priceData was found for this target, it will be stored here.
      Since:
      2.2.0
    • setCostPriceData

      public void setCostPriceData(Optional<PriceData> costPriceData)
      If a COST priceData was found for this target, it will be stored here.
      Since:
      2.2.0