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 Details

  • Constructor Details

    • PriceData

      public PriceData()
  • Method Details

    • compareTo

      public int compareTo(@Nullable PriceData o)
      Compares price. Null is more than non-null.
      Specified by:
      compareTo in interface Comparable<PriceData>
    • isActive

      public boolean isActive()
      Whether this PriceInfo is active based on the activeStartDate and activeEndDate.
    • getCharacteristics

      public Map<String,String> getCharacteristics()
    • setCharacteristics

      public void setCharacteristics(Map<String,String> newCharacteristics)
    • getTerm

      public String getTerm()
    • getId

      public String getId()
    • getPriceListId

      public String getPriceListId()
      The contextId of the parent price list.
      See Also:
    • getPriceListName

      public String 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. Requires recurringPeriodFrequency, recurringPeriodType, termDurationLength, and termDurationType.
      Since:
      Pricing Service 2.1.0, Release Train 2.2.0
    • getUsagePrice

      public javax.money.MonetaryAmount getUsagePrice()
      The amount of the usage price. Optional. Requires usageUnits and usageAmount.
      Since:
      Pricing Service 2.1.0, Release Train 2.2.0
    • getActiveStartDate

      public Instant getActiveStartDate()
      Defines the beginning time for which this price data is active.
    • getActiveEndDate

      public Instant getActiveEndDate()
      Defines the ending time for which this price data is active
    • getTiers

      public List<PriceDataTier> getTiers()
      Defines specific pricing for minimum quantities.
    • getStartingQuantity

      public Integer 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

      public Integer getAvailableQuantity()
      Defines the actual quantity available for this price data as the sale progresses. Initially it is set to the startingQuantity and is deducted as it gets used.
      See Also:
    • getName

      public String getName()
      The name for this price data.
    • getDescription

      public String getDescription()
      The description for this price data.
    • getUsageAmount

      public BigDecimal getUsageAmount()
      The unit of measure's amount for the usage price. Required for usagePrice. Requires usageUnits.
      Since:
      Pricing Service 2.1.0, Release Train 2.2.0
      See Also:
      • usagePrice
      • usageUnits
    • getUsageUnits

      public String getUsageUnits()
      The type of units used for the usage price. Required for usagePrice.
      Since:
      Pricing Service 2.1.0, Release Train 2.2.0
      See Also:
      • usagePrice
      • usageAmount
    • getRecurringPeriodFrequency

      public Integer getRecurringPeriodFrequency()
      The frequency with which to charge the recurringPrice.
      Since:
      Pricing Service 2.1.0, Release Train 2.2.0
      See Also:
      • recurringPrice
      • recurringPeriodType
    • getRecurringPeriodType

      public String 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

      public Integer 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

      public Integer 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

      public String 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

      public Integer 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

      public Map<String,Object> 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 of Tracking information to expose the context state for this object.
      Specified by:
      getContextState in interface com.broadleafcommerce.data.tracking.core.ContextStateAware
      Returns:
      a subset of Tracking information to expose the context state for this object
    • setId

      public void setId(String id)
    • setPriceListId

      public void setPriceListId(String priceListId)
      The contextId of the parent price list.
      See Also:
    • setPriceListName

      public void setPriceListName(String priceListName)
      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. Requires recurringPeriodFrequency, recurringPeriodType, termDurationLength, and termDurationType.
      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. Requires usageUnits and usageAmount.
      Since:
      Pricing Service 2.1.0, Release Train 2.2.0
    • setActiveStartDate

      public void setActiveStartDate(Instant activeStartDate)
      Defines the beginning time for which this price data is active.
    • setActiveEndDate

      public void setActiveEndDate(Instant activeEndDate)
      Defines the ending time for which this price data is active
    • setTiers

      public void setTiers(List<PriceDataTier> tiers)
      Defines specific pricing for minimum quantities.
    • setStartingQuantity

      public void setStartingQuantity(Integer startingQuantity)
      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

      public void setAvailableQuantity(Integer availableQuantity)
      Defines the actual quantity available for this price data as the sale progresses. Initially it is set to the startingQuantity and is deducted as it gets used.
      See Also:
    • setName

      public void setName(String name)
      The name for this price data.
    • setDescription

      public void setDescription(String description)
      The description for this price data.
    • setUsageAmount

      public void setUsageAmount(BigDecimal usageAmount)
      The unit of measure's amount for the usage price. Required for usagePrice. Requires usageUnits.
      Since:
      Pricing Service 2.1.0, Release Train 2.2.0
      See Also:
      • usagePrice
      • usageUnits
    • setUsageUnits

      public void setUsageUnits(String usageUnits)
      The type of units used for the usage price. Required for usagePrice.
      Since:
      Pricing Service 2.1.0, Release Train 2.2.0
      See Also:
      • usagePrice
      • usageAmount
    • setRecurringPeriodFrequency

      public void setRecurringPeriodFrequency(Integer recurringPeriodFrequency)
      The frequency with which to charge the recurringPrice.
      Since:
      Pricing Service 2.1.0, Release Train 2.2.0
      See Also:
      • recurringPrice
      • recurringPeriodType
    • setRecurringPeriodType

      public void setRecurringPeriodType(String recurringPeriodType)
      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

      public void setRecurringPeriodLimit(Integer recurringPeriodLimit)
      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

      public void setTermDurationLength(Integer termDurationLength)
      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

      public void setTermDurationType(String termDurationType)
      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

      public void setPriority(Integer priority)
      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

      public void setAttributes(Map<String,Object> attributes)
      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 of Tracking information to expose the context state for this object.
      Specified by:
      setContextState in interface com.broadleafcommerce.data.tracking.core.ContextStateAware
      Parameters:
      contextState - a subset of Tracking information to expose the context state for this object
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • canEqual

      protected boolean canEqual(Object other)
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object