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

      public PriceableTargetPriceState withPriceListTypes(List<String> priceListTypes)
    • withPriceListIdPriceListMap

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

      public PriceableTargetPriceState withPriceListAndTargetPriceDataMap(Map<org.apache.commons.lang3.tuple.Pair<String,com.broadleafcommerce.pricing.client.domain.PriceableTargetRef>,PriceData> priceListAndTargetPriceDataMap)
    • 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
    • putPriceListPriceMapping

      @Deprecated(forRemoval=true, since="1.7.14, 2.0.1") public void putPriceListPriceMapping(PriceList priceList, javax.money.MonetaryAmount price)
      Deprecated, for removal: This API element is subject to removal in a future version.
    • putPriceListPriceDetailMapping

      public void putPriceListPriceDetailMapping(PriceList priceList, PriceListPriceDetail priceListPriceDetail)
      Put a price list price mapping. This will automatically resolve the correct price list type.
    • 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.
    • getPriceListTypes

      public List<String> getPriceListTypes()
    • 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,com.broadleafcommerce.pricing.client.domain.PriceableTargetRef>,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.