Class PriceableTargetPriceState
java.lang.Object
com.broadleafcommerce.pricing.service.state.PriceableTargetPriceState
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. SeestdPriceDetailByPriceListPrice,salePriceDetailByPriceListPrice,contractPriceDetailByPriceListPrice. - 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).
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionMap of price type (e.g., standardPrice, salePrice, contractPrice) to thePriceDetailof the "best" backup price for that type.Composite of all price list price mapsDeprecated, for removal: This API element is subject to removal in a future version.Deprecated.in favor ofcontractPriceDetailByPriceListPriceIf a COST priceData was found for this target, it will be stored here.protected Map<PriceList,PriceListPriceDetail> Extension point for additional price list typesDeprecated, for removal: This API element is subject to removal in a future version.in favor ofgetOtherPriceListPriceDetailMapping(String)com.broadleafcommerce.pricing.client.domain.context.PriceInfoContextThePriceInfoContextfor the current pricing flow.Map<org.apache.commons.lang3.tuple.Pair<String,TargetKeyDto>, List<PriceData>> All first-level price lists mapped to the price data they aggregate.All first-level price lists mapped to the price lists they represent.Gets the price list price mapping for the price list typeDeprecated, for removal: This API element is subject to removal in a future version.in favor ofgetPriceListPriceDetailMappingForType(String)Deprecated.unusedMap of price type (e.g., standardPrice, salePrice, contractPrice) to thePriceDetailof the "best" price for that type.javax.money.CurrencyUnitGets the currency that was requested for the current pricing context.Deprecated.in favor ofsalePriceDetailByPriceListPriceDeprecated.in favor ofstdPriceDetailByPriceListPriceprotected voidExtension point for additional price list typesprotected voidputOtherPriceListPriceMaps(Map<PriceList, javax.money.MonetaryAmount> composite) Deprecated, for removal: This API element is subject to removal in a future version.in favor ofputOtherPriceListPriceDetailMaps(Map)voidputPriceListPriceDetailMapping(PriceList priceList, PriceListPriceDetail priceListPriceDetail) Put a price list price mapping.voidsetCostPriceData(Optional<PriceData> costPriceData) If a COST priceData was found for this target, it will be stored here.withPriceInfoContext(com.broadleafcommerce.pricing.client.domain.context.PriceInfoContext priceInfoContext) withPriceListAndTargetPriceDataMap(Map<org.apache.commons.lang3.tuple.Pair<String, TargetKeyDto>, List<PriceData>> priceListAndTargetPriceDataMap) withPriceListIdPriceListMap(Map<String, PriceList> priceListIdPriceListMap) withPriceListTypes(List<String> priceListTypes) Deprecated, for removal: This API element is subject to removal in a future version.
-
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.in favor ofgetCompositePriceListPriceDetailMap() -
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.in favor ofputOtherPriceListPriceDetailMaps(Map) -
putOtherPriceListPriceDetailMaps
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.in favor ofgetPriceListPriceDetailMappingForType(String) -
getPriceListPriceDetailMappingForType
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.in favor ofgetOtherPriceListPriceDetailMapping(String) -
getOtherPriceListPriceDetailMapping
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.in favor ofstdPriceDetailByPriceListPrice -
getSalePriceListPriceMap
Deprecated.in favor ofsalePriceDetailByPriceListPrice -
getContractPriceListPriceMap
Deprecated.in favor ofcontractPriceDetailByPriceListPrice -
getStdPriceDetailByPriceListPrice
- Since:
- 1.7.14, 2.0.1
-
getSalePriceDetailByPriceListPrice
- Since:
- 1.7.14, 2.0.1
-
getContractPriceDetailByPriceListPrice
- Since:
- 1.7.14, 2.0.1
-
getPrices
Map of price type (e.g., standardPrice, salePrice, contractPrice) to thePriceDetailof the "best" price for that type. -
getBackupPrices
Map of price type (e.g., standardPrice, salePrice, contractPrice) to thePriceDetailof 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.unused -
getPriceTiers
-
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>, getPriceListAndTargetPriceDataMap()List<PriceData>> 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()ThePriceInfoContextfor the current pricing flow.- Since:
- Pricing Services 2.2.0, Release Train 2.3.0
-
getCostPriceData
If a COST priceData was found for this target, it will be stored here.- Since:
- 2.2.0
-
setCostPriceData
If a COST priceData was found for this target, it will be stored here.- Since:
- 2.2.0
-
getCompositePriceListPriceDetailMap()