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 boolean
int
Compares price.boolean
Defines 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.ContextState
A subset ofTracking
information to expose the context state for this object.The description for this price data.getId()
getName()
The name for this price data.javax.money.MonetaryAmount
getPrice()
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.MonetaryAmount
The 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.PriceableTargetRef
getTerm()
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.MonetaryAmount
The amount of the usage price.The type of units used for the usage price.int
hashCode()
boolean
isActive()
Whether this PriceInfo is active based on theactiveStartDate
andactiveEndDate
.void
setActiveEndDate
(Instant activeEndDate) Defines the ending time for which this price data is activevoid
setActiveStartDate
(Instant activeStartDate) Defines the beginning time for which this price data is active.void
setAttributes
(Map<String, Object> attributes) Additional miscellaneous attributes to store about this price data.void
setAvailableQuantity
(Integer availableQuantity) Defines the actual quantity available for this price data as the sale progresses.void
setCharacteristics
(Map<String, String> newCharacteristics) void
setContextState
(com.broadleafcommerce.data.tracking.core.filtering.business.domain.ContextState contextState) A subset ofTracking
information to expose the context state for this object.void
setDescription
(String description) The description for this price data.void
void
The name for this price data.void
setPrice
(javax.money.MonetaryAmount price) The one-time price.void
setPriceListId
(String priceListId) The contextId of the parent price list.void
setPriceListName
(String priceListName) void
setPriority
(Integer priority) The priority of this price data.void
setRecurringPeriodFrequency
(Integer recurringPeriodFrequency) The frequency with which to charge therecurringPrice
.void
setRecurringPeriodLimit
(Integer recurringPeriodLimit) Defines the number of periods the price should recur.void
setRecurringPeriodType
(String recurringPeriodType) The period type for the recurring price, e.g.void
setRecurringPrice
(javax.money.MonetaryAmount recurringPrice) The amount of the recurring price.void
setStartingQuantity
(Integer startingQuantity) Defines the initial quantity available for this price data before a pricing event such as a flash sale.void
setTarget
(com.broadleafcommerce.pricing.client.domain.PriceableTargetRef target) void
setTermDurationLength
(Integer termDurationLength) The length of the pricing terms, e.g., 36 for a 36 month contract.void
setTermDurationType
(String termDurationType) The duration type for the recurring price, e.g.void
setTiers
(List<PriceDataTier> tiers) Defines specific pricing for minimum quantities.void
setUsageAmount
(BigDecimal usageAmount) The unit of measure's amount for the usage price.void
setUsagePrice
(javax.money.MonetaryAmount usagePrice) The amount of the usage price.void
setUsageUnits
(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:
compareTo
in interfaceComparable<PriceData>
-
isActive
public boolean isActive()Whether this PriceInfo is active based on theactiveStartDate
andactiveEndDate
. -
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:
-
PriceableTargetRef
PriceableTarget
-
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. RequiresusageUnits
andusageAmount
.- 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 thestartingQuantity
and 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:
-
usagePrice
usageUnits
-
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:
-
usagePrice
usageAmount
-
getRecurringPeriodFrequency
The frequency with which to charge therecurringPrice
.- Since:
- Pricing Service 2.1.0, Release Train 2.2.0
- See Also:
-
recurringPrice
recurringPeriodType
-
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:
-
recurringPrice
recurringPeriodFrequency
-
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:
-
recurringPrice
recurringPeriodType
recurringPeriodFrequency
-
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:
-
recurringPrice
termDurationType
-
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:
-
recurringPrice
termDurationLength
-
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 ofTracking
information to expose the context state for this object.- Specified by:
getContextState
in interfacecom.broadleafcommerce.data.tracking.core.ContextStateAware
- Returns:
- a subset of
Tracking
information 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:
-
PriceableTargetRef
PriceableTarget
-
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. RequiresusageUnits
andusageAmount
.- 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 thestartingQuantity
and 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:
-
usagePrice
usageUnits
-
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:
-
usagePrice
usageAmount
-
setRecurringPeriodFrequency
The frequency with which to charge therecurringPrice
.- Since:
- Pricing Service 2.1.0, Release Train 2.2.0
- See Also:
-
recurringPrice
recurringPeriodType
-
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:
-
recurringPrice
recurringPeriodFrequency
-
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:
-
recurringPrice
recurringPeriodType
recurringPeriodFrequency
-
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:
-
recurringPrice
termDurationType
-
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:
-
recurringPrice
termDurationLength
-
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 ofTracking
information to expose the context state for this object.- Specified by:
setContextState
in interfacecom.broadleafcommerce.data.tracking.core.ContextStateAware
- Parameters:
contextState
- a subset ofTracking
information to expose the context state for this object
-
toString
-
equals
-
canEqual
-
hashCode
public int hashCode()
-