Class PriceListPriceDetail

java.lang.Object
com.broadleafcommerce.pricing.domain.PriceListPriceDetail
All Implemented Interfaces:
com.broadleafcommerce.pricing.client.domain.PriceDetailComparable, Serializable

public class PriceListPriceDetail extends Object implements Serializable, com.broadleafcommerce.pricing.client.domain.PriceDetailComparable
DTO containing the details of a price from a price list.
Since:
1.7.14, 2.0.1
Author:
Sunny Yu
See Also:
  • Constructor Details

    • PriceListPriceDetail

      public PriceListPriceDetail()
  • Method Details

    • hasLimitedQuantity

      public boolean hasLimitedQuantity()
    • getPrice

      public javax.money.MonetaryAmount getPrice()
      Price determined from a PriceList.getPriceModifier() or PriceData.getPrice() for a particular list.
      Specified by:
      getPrice in interface com.broadleafcommerce.pricing.client.domain.PriceDetailComparable
      See Also:
      • PriceDetailComparable.getPrice()
    • getPaymentStrategy

      public String getPaymentStrategy()
      Only relevant for price that came from a specific PriceData.

      Represents the payment strategy, specifically when payment is billed for a recurring price.

      Specified by:
      getPaymentStrategy in interface com.broadleafcommerce.pricing.client.domain.PriceDetailComparable
      See Also:
      • DefaultPaymentStrategy
    • getRecurringPriceDetail

      public com.broadleafcommerce.pricing.client.domain.RecurringPriceDetail getRecurringPriceDetail()
      Specified by:
      getRecurringPriceDetail in interface com.broadleafcommerce.pricing.client.domain.PriceDetailComparable
      Since:
      Pricing Service 2.1.0, Release Train 2.2.0
      See Also:
      • PriceDetailComparable.getRecurringPriceDetail()
    • getUsagePriceDetail

      public com.broadleafcommerce.pricing.client.domain.UsagePriceDetail getUsagePriceDetail()
      Specified by:
      getUsagePriceDetail in interface com.broadleafcommerce.pricing.client.domain.PriceDetailComparable
      Since:
      Pricing Service 2.1.0, Release Train 2.2.0
      See Also:
      • PriceDetailComparable.getUsagePriceDetail()
    • getPriceSource

      public String getPriceSource()
      The source of this price within the price list, e.g. price list formula, price list price data, etc.
      See Also:
      • DefaultPriceListPriceSources
    • getPriceDataId

      public String getPriceDataId()
      Id of the specific PriceData that this price came from.

      Only applicable if the priceSource is DefaultPriceListPriceSources.BLC_PRICE_LIST_PRICE_DATA.

    • getPriority

      public Integer getPriority()
      Specified by:
      getPriority in interface com.broadleafcommerce.pricing.client.domain.PriceDetailComparable
      Since:
      Pricing Service 2.1.0, Release Train 2.2.0
      See Also:
      • PriceDetailComparable.getPriority()
    • getPriceListPriority

      public Integer getPriceListPriority()
      Specified by:
      getPriceListPriority in interface com.broadleafcommerce.pricing.client.domain.PriceDetailComparable
      Since:
      Pricing Service 2.1.0, Release Train 2.2.0
      See Also:
      • PriceDetailComparable.getPriceListPriority()
    • getActiveStartDate

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

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

      public Integer 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.
    • getAvailableQuantity

      public Integer getAvailableQuantity()
      Defines the actual quantity available of a product as the sale progresses. Initially it is set equal to the startingQuantity and is deducted as and when it gets used.
    • getCancellationPolicyRef

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

      public Optional<PriceListPriceDetail> getBackupPriceDetail()
      Transfers the backupPriceSummary from the Summary to this price detail.
    • getPriceData

      public PriceData getPriceData()
      Store the priceData on this intermediary object to allow for consistent sorting of PriceListPriceDetail objects.
    • getDerivedFromFieldType

      public String 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 VARIANT_BASE_FIELD, or BASE_FIELD.
      Returns:
      Returns one of {"PRICE_DATA_FIELD", "VARIANT_BASE_FIELD", "BASE_FIELD"}
    • getPriceDataTierList

      public List<com.broadleafcommerce.pricing.client.domain.PriceDataTierRef> getPriceDataTierList()
      When a price list modifies an underlying price data that uses tiered pricing, also modify each tiered price and store it on this price detail.
      Since:
      Pricing Service 2.2.0, Release Train 2.3.0
      See Also:
      • PriceDataTierRef
    • setPrice

      public void setPrice(javax.money.MonetaryAmount price)
      Price determined from a PriceList.getPriceModifier() or PriceData.getPrice() for a particular list.
      See Also:
      • PriceDetailComparable.getPrice()
    • setPaymentStrategy

      public void setPaymentStrategy(String paymentStrategy)
      Only relevant for price that came from a specific PriceData.

      Represents the payment strategy, specifically when payment is billed for a recurring price.

      See Also:
      • DefaultPaymentStrategy
    • setRecurringPriceDetail

      public void setRecurringPriceDetail(com.broadleafcommerce.pricing.client.domain.RecurringPriceDetail recurringPriceDetail)
      Since:
      Pricing Service 2.1.0, Release Train 2.2.0
      See Also:
      • PriceDetailComparable.getRecurringPriceDetail()
    • setUsagePriceDetail

      public void setUsagePriceDetail(com.broadleafcommerce.pricing.client.domain.UsagePriceDetail usagePriceDetail)
      Since:
      Pricing Service 2.1.0, Release Train 2.2.0
      See Also:
      • PriceDetailComparable.getUsagePriceDetail()
    • setPriceSource

      public void setPriceSource(String priceSource)
      The source of this price within the price list, e.g. price list formula, price list price data, etc.
      See Also:
      • DefaultPriceListPriceSources
    • setPriceDataId

      public void setPriceDataId(String priceDataId)
      Id of the specific PriceData that this price came from.

      Only applicable if the priceSource is DefaultPriceListPriceSources.BLC_PRICE_LIST_PRICE_DATA.

    • setPriority

      public void setPriority(Integer priority)
      Since:
      Pricing Service 2.1.0, Release Train 2.2.0
      See Also:
      • PriceDetailComparable.getPriority()
    • setPriceListPriority

      public void setPriceListPriority(Integer priceListPriority)
      Since:
      Pricing Service 2.1.0, Release Train 2.2.0
      See Also:
      • PriceDetailComparable.getPriceListPriority()
    • setActiveStartDate

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

      public void setActiveEndDate(Instant activeEndDate)
      Defines the ending time for which this price is active
    • 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 only serves an informational purpose.
    • setAvailableQuantity

      public void setAvailableQuantity(Integer availableQuantity)
      Defines the actual quantity available of a product as the sale progresses. Initially it is set equal to the startingQuantity and is deducted as and when it gets used.
    • setCancellationPolicyRef

      public void setCancellationPolicyRef(String cancellationPolicyRef)
      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
    • setBackupPriceDetail

      public void setBackupPriceDetail(Optional<PriceListPriceDetail> backupPriceDetail)
      Transfers the backupPriceSummary from the Summary to this price detail.
    • setPriceData

      public void setPriceData(PriceData priceData)
      Store the priceData on this intermediary object to allow for consistent sorting of PriceListPriceDetail objects.
    • setDerivedFromFieldType

      public void setDerivedFromFieldType(String derivedFromFieldType)
      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 VARIANT_BASE_FIELD, or BASE_FIELD.
      Parameters:
      derivedFromField - The type of field used in formula based pricing
    • setPriceDataTierList

      public void setPriceDataTierList(List<com.broadleafcommerce.pricing.client.domain.PriceDataTierRef> priceDataTierList)
      When a price list modifies an underlying price data that uses tiered pricing, also modify each tiered price and store it on this price detail.
      Since:
      Pricing Service 2.2.0, Release Train 2.3.0
      See Also:
      • PriceDataTierRef
    • 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
    • toString

      public String toString()
      Overrides:
      toString in class Object