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:
- Mappings between a price for a
PriceableTarget
and thePriceList
the provided that price for use in creatingPriceDetails
forPriceInfos
. SeestdPriceListPriceMap
,salePriceListPriceMap
,contractPriceListPriceMap
. - Mapping between a
PriceableTarget
prices and the name of the price, e.g., standardPrice, salePrice, and contractPrice. Seeprices
- Mapping between
PriceLists
and thePriceLists
they represent. This can be useful for fetching all first-level price lists at once rather than piece-meal. SeepriceListIdPriceListMap
- Mapping between
PriceLists
andPriceableTargets
to thePriceData
matching them. SeepriceListAndTargetPriceDataMap
- Set of all price list types. See
priceListTypes
.
- Author:
- Nathan Moore (nathanmoore).
- Mappings between a price for a
-
-
Constructor Summary
Constructors Constructor Description PriceableTargetPriceState()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Map<PriceList,javax.money.MonetaryAmount>
getCompositePriceListPriceMap()
Composite of all price list price mapsMap<PriceList,javax.money.MonetaryAmount>
getContractPriceListPriceMap()
protected Map<PriceList,javax.money.MonetaryAmount>
getOtherPriceListPriceMapping(String type)
Extension point for additional price list typesMap<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.Map<String,PriceList>
getPriceListIdPriceListMap()
All first-level price lists mapped to the price lists they represent.Map<PriceList,javax.money.MonetaryAmount>
getPriceListPriceMappingForType(String type)
Gets the price list price mapping for the price list typeList<String>
getPriceListTypes()
Map<String,com.broadleafcommerce.pricing.client.domain.PriceDetail>
getPrices()
Map of price type (e.g., standardPrice, salePrice, contractPrice) to thePriceDetail
of the "best" price for that type.Map<String,List<PriceDataTier>>
getPriceTiers()
Map<PriceList,javax.money.MonetaryAmount>
getSalePriceListPriceMap()
Map<PriceList,javax.money.MonetaryAmount>
getStdPriceListPriceMap()
protected void
putOtherPriceListPriceMaps(Map<PriceList,javax.money.MonetaryAmount> composite)
Extension point for additional price list typesvoid
putPriceListPriceMapping(PriceList priceList, javax.money.MonetaryAmount price)
Put a price list price mapping.PriceableTargetPriceState
withPriceListAndTargetPriceDataMap(Map<org.apache.commons.lang3.tuple.Pair<String,com.broadleafcommerce.pricing.client.domain.PriceableTargetRef>,PriceData> priceListAndTargetPriceDataMap)
PriceableTargetPriceState
withPriceListIdPriceListMap(Map<String,PriceList> priceListIdPriceListMap)
PriceableTargetPriceState
withPriceListTypes(List<String> priceListTypes)
-
-
-
Method Detail
-
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
public Map<PriceList,javax.money.MonetaryAmount> getCompositePriceListPriceMap()
Composite of all price list price maps
-
putOtherPriceListPriceMaps
protected void putOtherPriceListPriceMaps(Map<PriceList,javax.money.MonetaryAmount> composite)
Extension point for additional price list types
-
getPriceListPriceMappingForType
public Map<PriceList,javax.money.MonetaryAmount> getPriceListPriceMappingForType(String type)
Gets the price list price mapping for the price list type
-
getOtherPriceListPriceMapping
protected Map<PriceList,javax.money.MonetaryAmount> getOtherPriceListPriceMapping(String type)
Extension point for additional price list types
-
putPriceListPriceMapping
public void putPriceListPriceMapping(PriceList priceList, javax.money.MonetaryAmount price)
Put a price list price mapping. This will automatically resolve the correct price list type.
-
getSalePriceListPriceMap
public Map<PriceList,javax.money.MonetaryAmount> getSalePriceListPriceMap()
-
getContractPriceListPriceMap
public Map<PriceList,javax.money.MonetaryAmount> getContractPriceListPriceMap()
-
getPrices
public Map<String,com.broadleafcommerce.pricing.client.domain.PriceDetail> getPrices()
Map of price type (e.g., standardPrice, salePrice, contractPrice) to thePriceDetail
of the "best" price for that type.
-
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.
-
-