Class PriceTypeDetail
java.lang.Object
com.broadleafcommerce.pricing.client.domain.PriceTypeDetail
- All Implemented Interfaces:
Serializable
Aggregation of
PriceDetails for a specific type of price along with the price
and currency of the "best" of all the candidate PriceLists.- Author:
- Nathan Moore (nathandmoore)
- See Also:
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected booleanbooleanjavax.money.MonetaryAmountThe determined best price value for this type of price from amongst all the candidates.Represents the details related to a recurring (or subscription) price include the terms.Represents the details related to a usage price including the units.javax.money.CurrencyUnitExtracts theCurrencyUnitfrom the price fields onPriceTypeDetail.A PriceInfo can be the result of a formula based pricing algorithm.TheExchangeRateDetailused to convert the price from the original currency to thePriceInfoContext.getRequestedCurrency().Used to store the priceDataTiers for this detail.String representation of thePriceListthat providedbestPrice.getType()The corresponding type of the price: salePrice, standardPrice, contractPrice, etc.inthashCode()booleanbooleanWhether the current priceTypeDetail record has a convertedPriceTypeDetailrecord which has been converted from thegetCurrency()to thePriceInfoContext.getRequestedCurrency().voidsetBestPrice(javax.money.MonetaryAmount bestPrice) The determined best price value for this type of price from amongst all the candidates.voidsetBestRecurringPriceDetail(RecurringPriceDetail bestRecurringPriceDetail) Represents the details related to a recurring (or subscription) price include the terms.voidsetBestUsagePriceDetail(UsagePriceDetail bestUsagePriceDetail) Represents the details related to a usage price including the units.voidsetDerivedFromFieldType(String derivedFromFieldType) A PriceInfo can be the result of a formula based pricing algorithm.voidsetExchangeRateDetail(ExchangeRateDetail exchangeRateDetail) TheExchangeRateDetailused to convert the price from the original currency to thePriceInfoContext.getRequestedCurrency().voidsetHasCurrencyConversion(boolean hasCurrencyConversion) Whether the current priceTypeDetail record has a convertedPriceTypeDetailrecord which has been converted from thegetCurrency()to thePriceInfoContext.getRequestedCurrency().voidsetPriceDataTierList(List<PriceDataTierRef> priceDataTierList) Used to store the priceDataTiers for this detail.voidsetPriceDetails(Map<String, PriceDetail> priceDetails) voidsetPriceListId(String priceListId) String representation of thePriceListthat providedbestPrice.voidThe corresponding type of the price: salePrice, standardPrice, contractPrice, etc.toString()
-
Field Details
-
VARIANT_BASE_FIELD
-
BASE_FIELD
-
PRICE_DATA_FIELD
-
-
Constructor Details
-
PriceTypeDetail
public PriceTypeDetail()
-
-
Method Details
-
getCurrency
@Nullable public javax.money.CurrencyUnit getCurrency()Extracts theCurrencyUnitfrom the price fields onPriceTypeDetail.It looks for
getBestRecurringPriceDetail(),getBestUsagePriceDetail()andgetBestPrice()to determine theCurrencyUnit.Returns
nullif theCurrencyUnitis not found.- Returns:
- the
CurrencyUnitin which the prices are present for thisPriceTypeDetail - Since:
- 2.0.4
-
isDirectlyFromVariant
public boolean isDirectlyFromVariant() -
getType
The corresponding type of the price: salePrice, standardPrice, contractPrice, etc.- Returns:
- The corresponding type of the price: salePrice, standardPrice, contractPrice, etc.
-
getDerivedFromFieldType
A PriceInfo can be the result of a formula based pricing algorithm. For example, a sale price might be 10% off of the retail price. For proper sorting by the caller, it can be important to know the way that the price was derived. By default, for price infos and details returned from a formula, the derivedFromField will be either PRICE_DATA_FIELD, VARIANT_BASE_FIELD, or BASE_FIELD.- Returns:
- Returns one of {"PRICE_DATA_FIELD", "VARIANT_BASE_FIELD", "BASE_FIELD", or null (representing none or unknown)}
-
getBestPrice
public javax.money.MonetaryAmount getBestPrice()The determined best price value for this type of price from amongst all the candidates.- Returns:
- The determined best price value for this type of price from amongst all the candidates.
-
getBestRecurringPriceDetail
Represents the details related to a recurring (or subscription) price include the terms.- Since:
- Pricing Client 2.0.3
-
getBestUsagePriceDetail
Represents the details related to a usage price including the units.- Since:
- Pricing Client 2.0.3
-
getPriceListId
String representation of thePriceListthat providedbestPrice.- Returns:
- String representation of the
PriceListthat providedbestPrice. - See Also:
-
isHasCurrencyConversion
public boolean isHasCurrencyConversion()Whether the current priceTypeDetail record has a convertedPriceTypeDetailrecord which has been converted from thegetCurrency()to thePriceInfoContext.getRequestedCurrency().This flag is set on the original
PriceTypeDetailto indicate the presence of a correspondingPriceInfo.getConvertedPriceTypeDetails()entry.- Since:
- 2.0.4
-
getExchangeRateDetail
TheExchangeRateDetailused to convert the price from the original currency to thePriceInfoContext.getRequestedCurrency().- Since:
- 2.0.4
-
getPriceDetails
- Returns:
- A map for every candidate
PriceListfor thetype, with the key being aPriceListRef.getId(). - See Also:
-
getPriceDataTierList
Used to store the priceDataTiers for this detail.- Since:
- 2.0.4
-
setType
The corresponding type of the price: salePrice, standardPrice, contractPrice, etc.- Parameters:
type- The corresponding type of the price: salePrice, standardPrice, contractPrice, etc.
-
setDerivedFromFieldType
A PriceInfo can be the result of a formula based pricing algorithm. For example, a sale price might be 10% off of the retail price. For proper sorting by the caller, it can be important to know the way that the price was derived. By default, for price infos and details returned from a formula, the derivedFromField will be either PRICE_DATA_FIELD, VARIANT_BASE_FIELD, or BASE_FIELD.- Parameters:
derivedFromField- The type of field used in formula based pricing
-
setBestPrice
public void setBestPrice(javax.money.MonetaryAmount bestPrice) The determined best price value for this type of price from amongst all the candidates.- Parameters:
bestPrice- The determined best price value for this type of price from amongst all the candidates.
-
setBestRecurringPriceDetail
Represents the details related to a recurring (or subscription) price include the terms.- Since:
- Pricing Client 2.0.3
-
setBestUsagePriceDetail
Represents the details related to a usage price including the units.- Since:
- Pricing Client 2.0.3
-
setPriceListId
String representation of thePriceListthat providedbestPrice.- Parameters:
priceListId- String representation of thePriceListthat providedbestPrice.- See Also:
-
setHasCurrencyConversion
public void setHasCurrencyConversion(boolean hasCurrencyConversion) Whether the current priceTypeDetail record has a convertedPriceTypeDetailrecord which has been converted from thegetCurrency()to thePriceInfoContext.getRequestedCurrency().This flag is set on the original
PriceTypeDetailto indicate the presence of a correspondingPriceInfo.getConvertedPriceTypeDetails()entry.- Since:
- 2.0.4
-
setExchangeRateDetail
TheExchangeRateDetailused to convert the price from the original currency to thePriceInfoContext.getRequestedCurrency().- Since:
- 2.0.4
-
setPriceDetails
- Parameters:
priceDetails- A map for every candidatePriceListfor thetype, with the key being aPriceListRef.getId().- See Also:
-
setPriceDataTierList
Used to store the priceDataTiers for this detail.- Since:
- 2.0.4
-
equals
-
canEqual
-
hashCode
public int hashCode() -
toString
-