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
PriceableTargetand thePriceListthe provided that price for use in creatingPriceDetailsforPriceInfos. SeestdPriceListPriceMap,salePriceListPriceMap,contractPriceListPriceMap. - Mapping between a
PriceableTargetprices and the name of the price, e.g., standardPrice, salePrice, and contractPrice. Seeprices - Mapping between
PriceListsand thePriceListsthey represent. This can be useful for fetching all first-level price lists at once rather than piece-meal. SeepriceListIdPriceListMap - Mapping between
PriceListsandPriceableTargetsto thePriceDatamatching 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 thePriceDetailof the "best" price for that type.Map<String,List<PriceDataTier>>getPriceTiers()Map<PriceList,javax.money.MonetaryAmount>getSalePriceListPriceMap()Map<PriceList,javax.money.MonetaryAmount>getStdPriceListPriceMap()protected voidputOtherPriceListPriceMaps(Map<PriceList,javax.money.MonetaryAmount> composite)Extension point for additional price list typesvoidputPriceListPriceMapping(PriceList priceList, javax.money.MonetaryAmount price)Put a price list price mapping.PriceableTargetPriceStatewithPriceListAndTargetPriceDataMap(Map<org.apache.commons.lang3.tuple.Pair<String,com.broadleafcommerce.pricing.client.domain.PriceableTargetRef>,PriceData> priceListAndTargetPriceDataMap)PriceableTargetPriceStatewithPriceListIdPriceListMap(Map<String,PriceList> priceListIdPriceListMap)PriceableTargetPriceStatewithPriceListTypes(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 thePriceDetailof 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.
-
-