Class PriceData
- All Implemented Interfaces:
com.broadleafcommerce.data.tracking.core.ContextStateAware,Serializable,Comparable<PriceData>
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.The amount to adjust apriceOnly valid for aPriceListType.ADJUSTMENTtype price list.Indicates the type of operation to use when#isForMarkup()is true}.For PriceData's whose#isForMarkup()is true}, indicates how the markup relates to aPriceListmarkup.Additional miscellaneous attributes to store about this price data.Defines the actual quantity available for this price data as the sale progresses.A reference (typically the Id) of the CancellationPolicy for this priceData that governs how this priceData's subscription would be cancelled.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.intThe payment strategy of the price data, e.g.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.The name of the attribute used for two-tier pricing.The strategy used to determine tier pricing.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()booleanbooleanisActive()Whether this PriceInfo is active based on theactiveStartDateandactiveEndDate.booleanWhether this price data specifies an upfront price.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.voidsetAdjustmentAmount(BigDecimal adjustmentAmount) The amount to adjust apriceOnly valid for aPriceListType.ADJUSTMENTtype price list.voidsetAdjustmentOperationType(String adjustmentOperationType) Indicates the type of operation to use when#isForMarkup()is true}.voidsetAdjustmentPriceListRelationType(String adjustmentPriceListRelationType) For PriceData's whose#isForMarkup()is true}, indicates how the markup relates to aPriceListmarkup.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.voidsetCancellationPolicyRef(String cancellationPolicyRef) A reference (typically the Id) of the CancellationPolicy for this priceData that governs how this priceData's subscription would be cancelled.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.voidsetPaymentStrategy(String paymentStrategy) The payment strategy of the price data, e.g.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.voidsetSpecifyUpfrontPrice(boolean specifyUpfrontPrice) Whether this price data specifies an upfront 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.voidsetTierAttributeName(String tierAttributeName) The name of the attribute used for two-tier pricing.voidsetTierPricingStrategy(String tierPricingStrategy) The strategy used to determine tier pricing.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
-
getFrequency
-
getVendorRef
-
getNumberOfCharacteristics
public int getNumberOfCharacteristics() -
hasLimitedQuantity
public boolean hasLimitedQuantity() -
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
-
isSpecifyUpfrontPrice
public boolean isSpecifyUpfrontPrice()Whether this price data specifies an upfront price.This is only relevant for price data with
DefaultPaymentStrategy.PREPAIDandDefaultPaymentStrategy.POSTPAIDstrategies.For
DefaultPaymentStrategy.PREPAID, this means whether the upfront price is different from the recurring price. If true, the upfront price is specified inprice. Otherwise the upfront price is the same as the recurring price.For
DefaultPaymentStrategy.POSTPAID, this means whether an upfront price should be charged. If true, the upfront price is specified inprice. Otherwise, the upfront price defaults to zero. -
getPrice
public javax.money.MonetaryAmount getPrice()The one-time price. This is typically used during checkout. Not used for a price data that is part of anPriceListType.ADJUSTMENTprice list. -
getAdjustmentAmount
The amount to adjust apriceOnly valid for aPriceListType.ADJUSTMENTtype price list. -
getAdjustmentOperationType
Indicates the type of operation to use when#isForMarkup()is true}.- See Also:
-
getAdjustmentPriceListRelationType
For PriceData's whose#isForMarkup()is true}, indicates how the markup relates to aPriceListmarkup. By default, only the PriceData markup will be used but this value can be used to run both the PriceList and PriceData markups from the same PriceList.- See Also:
-
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
-
getPaymentStrategy
The payment strategy of the price data, e.g. ONE_TIME, PREPAID, POSTPAID- Since:
- Pricing Service 2.1.0
- See Also:
-
recurringPricetermDurationLengthDefaultPaymentStrategy
-
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. MONTHLY, QUARTERLY, ANNUALLY.- Since:
- Pricing Service 2.1.0, Release Train 2.2.0
- See Also:
-
recurringPricerecurringPeriodFrequencyDefaultRecurringPeriodType
-
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:
-
recurringPricetermDurationLengthDefaultTermDurationType
-
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
-
getTierPricingStrategy
The strategy used to determine tier pricing.- Since:
- Pricing Service 2.2.0, Release Train 2.3.0
- See Also:
-
getTierAttributeName
The name of the attribute used for two-tier pricing.- Since:
- Pricing Service 2.2.0, Release Train 2.3.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
-
getCancellationPolicyRef
A reference (typically the Id) of the CancellationPolicy for this priceData that governs how this priceData's subscription would be cancelled.- Since:
- Pricing Services 2.2.0, Release Train 2.3.0
-
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
-
setSpecifyUpfrontPrice
public void setSpecifyUpfrontPrice(boolean specifyUpfrontPrice) Whether this price data specifies an upfront price.This is only relevant for price data with
DefaultPaymentStrategy.PREPAIDandDefaultPaymentStrategy.POSTPAIDstrategies.For
DefaultPaymentStrategy.PREPAID, this means whether the upfront price is different from the recurring price. If true, the upfront price is specified inprice. Otherwise the upfront price is the same as the recurring price.For
DefaultPaymentStrategy.POSTPAID, this means whether an upfront price should be charged. If true, the upfront price is specified inprice. Otherwise, the upfront price defaults to zero. -
setPrice
public void setPrice(javax.money.MonetaryAmount price) The one-time price. This is typically used during checkout. Not used for a price data that is part of anPriceListType.ADJUSTMENTprice list. -
setAdjustmentAmount
The amount to adjust apriceOnly valid for aPriceListType.ADJUSTMENTtype price list. -
setAdjustmentOperationType
Indicates the type of operation to use when#isForMarkup()is true}.- See Also:
-
setAdjustmentPriceListRelationType
For PriceData's whose#isForMarkup()is true}, indicates how the markup relates to aPriceListmarkup. By default, only the PriceData markup will be used but this value can be used to run both the PriceList and PriceData markups from the same PriceList.- See Also:
-
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
-
setPaymentStrategy
The payment strategy of the price data, e.g. ONE_TIME, PREPAID, POSTPAID- Since:
- Pricing Service 2.1.0
- See Also:
-
recurringPricetermDurationLengthDefaultPaymentStrategy
-
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. MONTHLY, QUARTERLY, ANNUALLY.- Since:
- Pricing Service 2.1.0, Release Train 2.2.0
- See Also:
-
recurringPricerecurringPeriodFrequencyDefaultRecurringPeriodType
-
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:
-
recurringPricetermDurationLengthDefaultTermDurationType
-
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
-
setTierPricingStrategy
The strategy used to determine tier pricing.- Since:
- Pricing Service 2.2.0, Release Train 2.3.0
- See Also:
-
setTierAttributeName
The name of the attribute used for two-tier pricing.- Since:
- Pricing Service 2.2.0, Release Train 2.3.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
-
setCancellationPolicyRef
A reference (typically the Id) of the CancellationPolicy for this priceData that governs how this priceData's subscription would be cancelled.- Since:
- Pricing Services 2.2.0, Release Train 2.3.0
-
toString
-
equals
-
canEqual
-
hashCode
public int hashCode()
-