Class PriceData
java.lang.Object
com.broadleafcommerce.pricing.domain.PriceData
- All Implemented Interfaces:
com.broadleafcommerce.data.tracking.core.ContextStateAware,Serializable,Comparable<PriceData>
public class PriceData
extends Object
implements Serializable, Comparable<PriceData>, com.broadleafcommerce.data.tracking.core.ContextStateAware
Data storing a specific price for a specific
PriceableTarget.- Author:
- Chad Harchar (charchar)
- See Also:
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected booleanintCompares price.booleanDefines the ending time for which this price data is activeDefines the beginning time for which this price data is active.Additional miscellaneous attributes to store about this price data.Defines the actual quantity available for this price data as the sale progresses.com.broadleafcommerce.data.tracking.core.filtering.business.domain.ContextStateA subset ofTrackinginformation to expose the context state for this object.The description for this price data.getId()getName()The name for this price data.javax.money.MonetaryAmountgetPrice()The one-time price.The contextId of the parent price list.The priority of this price data.The frequency with which to charge therecurringPrice.Defines the number of periods the price should recur.The period type for the recurring price, e.g.javax.money.MonetaryAmountThe amount of the recurring price.Defines the initial quantity available for this price data before a pricing event such as a flash sale.com.broadleafcommerce.pricing.client.domain.PriceableTargetRefgetTerm()The length of the pricing terms, e.g., 36 for a 36 month contract.The duration type for the recurring price, e.g.getTiers()Defines specific pricing for minimum quantities.The unit of measure's amount for the usage price.javax.money.MonetaryAmountThe amount of the usage price.The type of units used for the usage price.inthashCode()booleanisActive()Whether this PriceInfo is active based on theactiveStartDateandactiveEndDate.voidsetActiveEndDate(Instant activeEndDate) Defines the ending time for which this price data is activevoidsetActiveStartDate(Instant activeStartDate) Defines the beginning time for which this price data is active.voidsetAttributes(Map<String, Object> attributes) Additional miscellaneous attributes to store about this price data.voidsetAvailableQuantity(Integer availableQuantity) Defines the actual quantity available for this price data as the sale progresses.voidsetCharacteristics(Map<String, String> newCharacteristics) voidsetContextState(com.broadleafcommerce.data.tracking.core.filtering.business.domain.ContextState contextState) A subset ofTrackinginformation to expose the context state for this object.voidsetDescription(String description) The description for this price data.voidvoidThe name for this price data.voidsetPrice(javax.money.MonetaryAmount price) The one-time price.voidsetPriceListId(String priceListId) The contextId of the parent price list.voidsetPriceListName(String priceListName) voidsetPriority(Integer priority) The priority of this price data.voidsetRecurringPeriodFrequency(Integer recurringPeriodFrequency) The frequency with which to charge therecurringPrice.voidsetRecurringPeriodLimit(Integer recurringPeriodLimit) Defines the number of periods the price should recur.voidsetRecurringPeriodType(String recurringPeriodType) The period type for the recurring price, e.g.voidsetRecurringPrice(javax.money.MonetaryAmount recurringPrice) The amount of the recurring price.voidsetStartingQuantity(Integer startingQuantity) Defines the initial quantity available for this price data before a pricing event such as a flash sale.voidsetTarget(com.broadleafcommerce.pricing.client.domain.PriceableTargetRef target) voidsetTermDurationLength(Integer termDurationLength) The length of the pricing terms, e.g., 36 for a 36 month contract.voidsetTermDurationType(String termDurationType) The duration type for the recurring price, e.g.voidsetTiers(List<PriceDataTier> tiers) Defines specific pricing for minimum quantities.voidsetUsageAmount(BigDecimal usageAmount) The unit of measure's amount for the usage price.voidsetUsagePrice(javax.money.MonetaryAmount usagePrice) The amount of the usage price.voidsetUsageUnits(String usageUnits) The type of units used for the usage price.toString()
-
Field Details
-
PRICE_DATA_COMPARATOR
-
-
Constructor Details
-
PriceData
public PriceData()
-
-
Method Details
-
compareTo
Compares price. Null is more than non-null.- Specified by:
compareToin interfaceComparable<PriceData>
-
isActive
public boolean isActive()Whether this PriceInfo is active based on theactiveStartDateandactiveEndDate. -
getCharacteristics
-
setCharacteristics
-
getTerm
-
getId
-
getPriceListId
The contextId of the parent price list.- See Also:
-
getPriceListName
- See Also:
-
getTarget
public com.broadleafcommerce.pricing.client.domain.PriceableTargetRef getTarget()- See Also:
-
PriceableTargetRefPriceableTarget
-
getPrice
public javax.money.MonetaryAmount getPrice()The one-time price. This is typically used during checkout. -
getRecurringPrice
public javax.money.MonetaryAmount getRecurringPrice()The amount of the recurring price. Optional. RequiresrecurringPeriodFrequency,recurringPeriodType,termDurationLength, andtermDurationType.- Since:
- Pricing Service 2.1.0, Release Train 2.2.0
-
getUsagePrice
public javax.money.MonetaryAmount getUsagePrice()The amount of the usage price. Optional. RequiresusageUnitsandusageAmount.- Since:
- Pricing Service 2.1.0, Release Train 2.2.0
-
getActiveStartDate
Defines the beginning time for which this price data is active. -
getActiveEndDate
Defines the ending time for which this price data is active -
getTiers
Defines specific pricing for minimum quantities. -
getStartingQuantity
Defines the initial quantity available for this price data before a pricing event such as a flash sale. It is set only once during creation. After that it is read-only and serves an informational purpose. -
getAvailableQuantity
Defines the actual quantity available for this price data as the sale progresses. Initially it is set to thestartingQuantityand is deducted as it gets used.- See Also:
-
getName
The name for this price data. -
getDescription
The description for this price data. -
getUsageAmount
The unit of measure's amount for the usage price. Required forusagePrice. RequiresusageUnits.- Since:
- Pricing Service 2.1.0, Release Train 2.2.0
- See Also:
-
usagePriceusageUnits
-
getUsageUnits
The type of units used for the usage price. Required forusagePrice.- Since:
- Pricing Service 2.1.0, Release Train 2.2.0
- See Also:
-
usagePriceusageAmount
-
getRecurringPeriodFrequency
The frequency with which to charge therecurringPrice.- Since:
- Pricing Service 2.1.0, Release Train 2.2.0
- See Also:
-
recurringPricerecurringPeriodType
-
getRecurringPeriodType
The period type for the recurring price, e.g. DAY, MONTH, YEAR.- Since:
- Pricing Service 2.1.0, Release Train 2.2.0
- See Also:
-
recurringPricerecurringPeriodFrequency
-
getRecurringPeriodLimit
Defines the number of periods the price should recur. Only applicable for non-standard price lists, particularly sales where a discount may be applied for the first 'n' periods after which the price reverts to a standard price list's.- Since:
- Pricing Service 2.1.0, Release Train 2.2.0
- See Also:
-
recurringPricerecurringPeriodTyperecurringPeriodFrequency
-
getTermDurationLength
The length of the pricing terms, e.g., 36 for a 36 month contract.- Since:
- Pricing Service 2.1.0, Release Train 2.2.0
- See Also:
-
recurringPricetermDurationType
-
getTermDurationType
The duration type for the recurring price, e.g. DAYS, WEEKS, MONTHS, YEARS.- Since:
- Pricing Service 2.1.0, Release Train 2.2.0
- See Also:
-
recurringPricetermDurationLength
-
getPriority
The priority of this price data. This helps determine which the best price data is when multiple can apply to a target.- Since:
- Pricing Service 2.1.0, Release Train 2.2.0
-
getAttributes
Additional miscellaneous attributes to store about this price data.- Since:
- Pricing Service 2.1.0, Release Train 2.2.0
-
getContextState
public com.broadleafcommerce.data.tracking.core.filtering.business.domain.ContextState getContextState()A subset ofTrackinginformation to expose the context state for this object.- Specified by:
getContextStatein interfacecom.broadleafcommerce.data.tracking.core.ContextStateAware- Returns:
- a subset of
Trackinginformation to expose the context state for this object
-
setId
-
setPriceListId
The contextId of the parent price list.- See Also:
-
setPriceListName
- See Also:
-
setTarget
public void setTarget(com.broadleafcommerce.pricing.client.domain.PriceableTargetRef target) - See Also:
-
PriceableTargetRefPriceableTarget
-
setPrice
public void setPrice(javax.money.MonetaryAmount price) The one-time price. This is typically used during checkout. -
setRecurringPrice
public void setRecurringPrice(javax.money.MonetaryAmount recurringPrice) The amount of the recurring price. Optional. RequiresrecurringPeriodFrequency,recurringPeriodType,termDurationLength, andtermDurationType.- Since:
- Pricing Service 2.1.0, Release Train 2.2.0
-
setUsagePrice
public void setUsagePrice(javax.money.MonetaryAmount usagePrice) The amount of the usage price. Optional. RequiresusageUnitsandusageAmount.- Since:
- Pricing Service 2.1.0, Release Train 2.2.0
-
setActiveStartDate
Defines the beginning time for which this price data is active. -
setActiveEndDate
Defines the ending time for which this price data is active -
setTiers
Defines specific pricing for minimum quantities. -
setStartingQuantity
Defines the initial quantity available for this price data before a pricing event such as a flash sale. It is set only once during creation. After that it is read-only and serves an informational purpose. -
setAvailableQuantity
Defines the actual quantity available for this price data as the sale progresses. Initially it is set to thestartingQuantityand is deducted as it gets used.- See Also:
-
setName
The name for this price data. -
setDescription
The description for this price data. -
setUsageAmount
The unit of measure's amount for the usage price. Required forusagePrice. RequiresusageUnits.- Since:
- Pricing Service 2.1.0, Release Train 2.2.0
- See Also:
-
usagePriceusageUnits
-
setUsageUnits
The type of units used for the usage price. Required forusagePrice.- Since:
- Pricing Service 2.1.0, Release Train 2.2.0
- See Also:
-
usagePriceusageAmount
-
setRecurringPeriodFrequency
The frequency with which to charge therecurringPrice.- Since:
- Pricing Service 2.1.0, Release Train 2.2.0
- See Also:
-
recurringPricerecurringPeriodType
-
setRecurringPeriodType
The period type for the recurring price, e.g. DAY, MONTH, YEAR.- Since:
- Pricing Service 2.1.0, Release Train 2.2.0
- See Also:
-
recurringPricerecurringPeriodFrequency
-
setRecurringPeriodLimit
Defines the number of periods the price should recur. Only applicable for non-standard price lists, particularly sales where a discount may be applied for the first 'n' periods after which the price reverts to a standard price list's.- Since:
- Pricing Service 2.1.0, Release Train 2.2.0
- See Also:
-
recurringPricerecurringPeriodTyperecurringPeriodFrequency
-
setTermDurationLength
The length of the pricing terms, e.g., 36 for a 36 month contract.- Since:
- Pricing Service 2.1.0, Release Train 2.2.0
- See Also:
-
recurringPricetermDurationType
-
setTermDurationType
The duration type for the recurring price, e.g. DAYS, WEEKS, MONTHS, YEARS.- Since:
- Pricing Service 2.1.0, Release Train 2.2.0
- See Also:
-
recurringPricetermDurationLength
-
setPriority
The priority of this price data. This helps determine which the best price data is when multiple can apply to a target.- Since:
- Pricing Service 2.1.0, Release Train 2.2.0
-
setAttributes
Additional miscellaneous attributes to store about this price data.- Since:
- Pricing Service 2.1.0, Release Train 2.2.0
-
setContextState
public void setContextState(com.broadleafcommerce.data.tracking.core.filtering.business.domain.ContextState contextState) A subset ofTrackinginformation to expose the context state for this object.- Specified by:
setContextStatein interfacecom.broadleafcommerce.data.tracking.core.ContextStateAware- Parameters:
contextState- a subset ofTrackinginformation to expose the context state for this object
-
toString
-
equals
-
canEqual
-
hashCode
public int hashCode()
-