Class PriceDetail
java.lang.Object
com.broadleafcommerce.pricing.client.domain.PriceDetail
- All Implemented Interfaces:
PriceDetailComparable,Serializable
Details about the candidate prices and their originating
PriceListRef. These will be
aggregated on a PriceInfo.- Author:
- Chad Harchar (charchar)
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected booleanbooleanDefines the ending time for which this price is activeDefines the beginning time for which this price is active.javax.money.MonetaryAmountIf this price was modified by an adjustment PriceData record, stores the amount of the adjustment.If this price was modified by an adjustment PriceData record, stores the id of the adjustment PriceData.javax.money.MonetaryAmountIf this price was modified by a price modifier from an Adjustment PriceList stores the amount of the adjustment.If this price was modified by a price modifier from an Adjustment PriceList stores the id of the PriceList.The available quantity that can use this price data.A reference (typically the Id) of the CancellationPolicy for this priceData that governs how this priceData's subscription would be cancelled.A PriceInfo can be the result of a formula based pricing algorithm.Determines the strategy used when paying for a target using this price detail, whether the beginning or end of the billing period.javax.money.MonetaryAmountgetPrice()Price for thePriceInfo.getTarget()for a particularPriceList.Id of the specific PriceData that this price came from.PriceDataTiersfor thePriceInfo.getTarget().The relative priority of the parent price list vs other price lists that may have price details with the same target.The source of this price within the price list, e.g.The originating type of this corresponding price.The relative priority of this price detail vs others that might apply to the same target.Represents the details related to a recurring (or subscription) price include the terms.Defines the initial quantity available for this price data before a pricing event such as a flash sale.Represents the details related to a usage price including the units.inthashCode()booleanWhether this price is limited by quantity.voidsetActiveEndDate(Instant activeEndDate) Defines the ending time for which this price is activevoidsetActiveStartDate(Instant activeStartDate) Defines the beginning time for which this price is active.voidsetAdjustmentPriceDataAmount(javax.money.MonetaryAmount adjustmentPriceDataAmount) If this price was modified by an adjustment PriceData record, stores the amount of the adjustment.voidsetAdjustmentPriceDataId(String adjustmentPriceDataId) If this price was modified by an adjustment PriceData record, stores the id of the adjustment PriceData.voidsetAdjustmentPriceListAmount(javax.money.MonetaryAmount adjustmentPriceListAmount) If this price was modified by a price modifier from an Adjustment PriceList stores the amount of the adjustment.voidsetAdjustmentPriceListId(String adjustmentPriceListId) If this price was modified by a price modifier from an Adjustment PriceList stores the id of the PriceList.voidsetAvailableQuantity(Integer availableQuantity) The available quantity that can use this price data.voidsetCancellationPolicyRef(String cancellationPolicyRef) A reference (typically the Id) of the CancellationPolicy for this priceData that governs how this priceData's subscription would be cancelled.voidsetDerivedFromFieldType(String derivedFromFieldType) A PriceInfo can be the result of a formula based pricing algorithm.voidsetPaymentStrategy(String paymentStrategy) voidsetPrice(javax.money.MonetaryAmount price) voidsetPriceDataId(String priceDataId) Id of the specific PriceData that this price came from.voidsetPriceDataTierList(List<PriceDataTierRef> priceDataTierList) PriceDataTiersfor thePriceInfo.getTarget().voidsetPriceList(PriceListRef priceList) voidsetPriceListPriority(Integer priceListPriority) voidsetPriceSource(String priceSource) The source of this price within the price list, e.g.voidsetPriceType(String priceType) The originating type of this corresponding price.voidsetPriority(Integer priority) voidsetRecurringPriceDetail(RecurringPriceDetail recurringPriceDetail) voidsetStartingQuantity(Integer startingQuantity) Defines the initial quantity available for this price data before a pricing event such as a flash sale.voidsetUsagePriceDetail(UsagePriceDetail usagePriceDetail) toString()
-
Constructor Details
-
PriceDetail
public PriceDetail()
-
-
Method Details
-
hasLimitedQuantity
public boolean hasLimitedQuantity()Whether this price is limited by quantity.- Since:
- Pricing Client 2.0.3
-
getPrice
public javax.money.MonetaryAmount getPrice()Description copied from interface:PriceDetailComparablePrice for thePriceInfo.getTarget()for a particularPriceList.- Specified by:
getPricein interfacePriceDetailComparable- Returns:
- the Price for the
PriceInfo.getTarget()for a particularPriceList. - See Also:
-
getPaymentStrategy
Description copied from interface:PriceDetailComparableDetermines the strategy used when paying for a target using this price detail, whether the beginning or end of the billing period.- Specified by:
getPaymentStrategyin interfacePriceDetailComparable- Returns:
- The strategy used when paying for a target using this price detail
- Since:
- 2.0.4
- See Also:
-
getPriceDataId
Id of the specific PriceData that this price came from.Only applicable if the
priceSourceisDefaultPriceListPriceSources.BLC_PRICE_LIST_PRICE_DATA.- Since:
- Pricing Client 2.0.3
-
getAdjustmentPriceDataId
If this price was modified by an adjustment PriceData record, stores the id of the adjustment PriceData.- Since:
- Pricing Client 2.0.4
-
getAdjustmentPriceDataAmount
public javax.money.MonetaryAmount getAdjustmentPriceDataAmount()If this price was modified by an adjustment PriceData record, stores the amount of the adjustment.- Since:
- Pricing Client 2.0.4
-
getAdjustmentPriceListId
If this price was modified by a price modifier from an Adjustment PriceList stores the id of the PriceList.- Since:
- Pricing Client 2.0.4
-
getAdjustmentPriceListAmount
public javax.money.MonetaryAmount getAdjustmentPriceListAmount()If this price was modified by a price modifier from an Adjustment PriceList stores the amount of the adjustment.- Since:
- Pricing Client 2.0.4
-
getRecurringPriceDetail
Description copied from interface:PriceDetailComparableRepresents the details related to a recurring (or subscription) price include the terms.- Specified by:
getRecurringPriceDetailin interfacePriceDetailComparable- Returns:
- Represents the details related to a recurring (or subscription) price include the terms.
- Since:
- Pricing Client 2.0.3
- See Also:
-
getUsagePriceDetail
Description copied from interface:PriceDetailComparableRepresents the details related to a usage price including the units.- Specified by:
getUsagePriceDetailin interfacePriceDetailComparable- Returns:
- Represents the details related to a usage price including the units.
- Since:
- Pricing Client 2.0.3
- See Also:
-
getPriceList
- See Also:
-
getPriceSource
The source of this price within the price list, e.g. price list formula, price list price data, etc.This may be helpful for consuming services to determine the priority of the price. For example, a price from
DefaultPriceListPriceSources.BLC_PRICE_LIST_PRICE_DATAmay have a higher precedence overDefaultPriceListPriceSources.BLC_PRICE_LIST_FORMULA.- Since:
- 1.4.1, 2.0.1
- See Also:
-
getActiveStartDate
Defines the beginning time for which this price is active.- Since:
- Pricing Client 2.0.3
-
getActiveEndDate
Defines the ending time for which this price is active- Since:
- Pricing Client 2.0.3
-
getStartingQuantity
Defines the initial quantity available for this price data before a pricing event such as a flash sale. It only serves an informational purpose.- Since:
- Pricing Client 2.0.3
-
getAvailableQuantity
The available quantity that can use this price data. This is used for events such as a flash sale where the sale price is limited to a certain amount of quantity.- Since:
- Pricing Client 2.0.3
-
getPriceType
The originating type of this corresponding price. -
getPriceDataTierList
PriceDataTiersfor thePriceInfo.getTarget().- See Also:
-
getPriority
Description copied from interface:PriceDetailComparableThe relative priority of this price detail vs others that might apply to the same target.- Specified by:
getPriorityin interfacePriceDetailComparable- Returns:
- The relative priority of this price detail vs others that might apply to the same target.
- Since:
- PricingService 2.0.3
- See Also:
-
getPriceListPriority
Description copied from interface:PriceDetailComparableThe relative priority of the parent price list vs other price lists that may have price details with the same target.- Specified by:
getPriceListPriorityin interfacePriceDetailComparable- Returns:
- The relative priority of the parent price list vs other price lists that may have price details with the same target.
- Since:
- Pricing Client 2.0.3
- See Also:
-
getCancellationPolicyRef
A reference (typically the Id) of the CancellationPolicy for this priceData that governs how this priceData's subscription would be cancelled.- Since:
- 2.0.4
-
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}
-
setPrice
public void setPrice(javax.money.MonetaryAmount price) - See Also:
-
setPaymentStrategy
- Since:
- 2.0.4
- See Also:
-
setPriceDataId
Id of the specific PriceData that this price came from.Only applicable if the
priceSourceisDefaultPriceListPriceSources.BLC_PRICE_LIST_PRICE_DATA.- Since:
- Pricing Client 2.0.3
-
setAdjustmentPriceDataId
If this price was modified by an adjustment PriceData record, stores the id of the adjustment PriceData.- Since:
- Pricing Client 2.0.4
-
setAdjustmentPriceDataAmount
public void setAdjustmentPriceDataAmount(javax.money.MonetaryAmount adjustmentPriceDataAmount) If this price was modified by an adjustment PriceData record, stores the amount of the adjustment.- Since:
- Pricing Client 2.0.4
-
setAdjustmentPriceListId
If this price was modified by a price modifier from an Adjustment PriceList stores the id of the PriceList.- Since:
- Pricing Client 2.0.4
-
setAdjustmentPriceListAmount
public void setAdjustmentPriceListAmount(javax.money.MonetaryAmount adjustmentPriceListAmount) If this price was modified by a price modifier from an Adjustment PriceList stores the amount of the adjustment.- Since:
- Pricing Client 2.0.4
-
setRecurringPriceDetail
- Since:
- Pricing Client 2.0.3
- See Also:
-
setUsagePriceDetail
- Since:
- Pricing Client 2.0.3
- See Also:
-
setPriceList
- See Also:
-
setPriceSource
The source of this price within the price list, e.g. price list formula, price list price data, etc.This may be helpful for consuming services to determine the priority of the price. For example, a price from
DefaultPriceListPriceSources.BLC_PRICE_LIST_PRICE_DATAmay have a higher precedence overDefaultPriceListPriceSources.BLC_PRICE_LIST_FORMULA.- Since:
- 1.4.1, 2.0.1
- See Also:
-
setActiveStartDate
Defines the beginning time for which this price is active.- Since:
- Pricing Client 2.0.3
-
setActiveEndDate
Defines the ending time for which this price is active- Since:
- Pricing Client 2.0.3
-
setStartingQuantity
Defines the initial quantity available for this price data before a pricing event such as a flash sale. It only serves an informational purpose.- Since:
- Pricing Client 2.0.3
-
setAvailableQuantity
The available quantity that can use this price data. This is used for events such as a flash sale where the sale price is limited to a certain amount of quantity.- Since:
- Pricing Client 2.0.3
-
setPriceType
The originating type of this corresponding price. -
setPriceDataTierList
PriceDataTiersfor thePriceInfo.getTarget().- See Also:
-
setPriority
- Since:
- PricingService 2.0.3
- See Also:
-
setPriceListPriority
- Since:
- Pricing Client 2.0.3
- See Also:
-
setCancellationPolicyRef
A reference (typically the Id) of the CancellationPolicy for this priceData that governs how this priceData's subscription would be cancelled.- Since:
- 2.0.4
-
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
-
equals
-
canEqual
-
hashCode
public int hashCode() -
toString
-