Class PriceDetail

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

public class PriceDetail extends Object implements Serializable, PriceDetailComparable
Details about the candidate prices and their originating PriceListRef. These will be aggregated on a PriceInfo.
Author:
Chad Harchar (charchar)
See Also:
  • Constructor Details

    • PriceDetail

      public PriceDetail()
  • Method Details

    • hasLimitedQuantity

      public boolean hasLimitedQuantity()
      Whether this price is limited by quantity.
      Since:
      Pricing Client 2.0.3
    • getPrice

      public javax.money.MonetaryAmount getPrice()
      Description copied from interface: PriceDetailComparable
      Price for the PriceInfo.getTarget() for a particular PriceList.
      Specified by:
      getPrice in interface PriceDetailComparable
      Returns:
      the Price for the PriceInfo.getTarget() for a particular PriceList.
      See Also:
    • getPaymentStrategy

      public String getPaymentStrategy()
      Description copied from interface: PriceDetailComparable
      Determines the strategy used when paying for a target using this price detail, whether the beginning or end of the billing period.
      Specified by:
      getPaymentStrategy in interface PriceDetailComparable
      Returns:
      The strategy used when paying for a target using this price detail
      Since:
      2.0.4
      See Also:
    • 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.

      Since:
      Pricing Client 2.0.3
    • getAdjustmentPriceDataId

      public String getAdjustmentPriceDataId()
      If this price was modified by an adjustment PriceData record, stores the id of the adjustment PriceData.
      Since:
      Pricing Client 2.0.4
    • getAdjustmentPriceDataAmount

      public javax.money.MonetaryAmount getAdjustmentPriceDataAmount()
      If this price was modified by an adjustment PriceData record, stores the amount of the adjustment.
      Since:
      Pricing Client 2.0.4
    • getAdjustmentPriceListId

      public String getAdjustmentPriceListId()
      If this price was modified by a price modifier from an Adjustment PriceList stores the id of the PriceList.
      Since:
      Pricing Client 2.0.4
    • getAdjustmentPriceListAmount

      public javax.money.MonetaryAmount getAdjustmentPriceListAmount()
      If this price was modified by a price modifier from an Adjustment PriceList stores the amount of the adjustment.
      Since:
      Pricing Client 2.0.4
    • getRecurringPriceDetail

      public RecurringPriceDetail getRecurringPriceDetail()
      Description copied from interface: PriceDetailComparable
      Represents the details related to a recurring (or subscription) price include the terms.
      Specified by:
      getRecurringPriceDetail in interface PriceDetailComparable
      Returns:
      Represents the details related to a recurring (or subscription) price include the terms.
      Since:
      Pricing Client 2.0.3
      See Also:
    • getUsagePriceDetail

      public UsagePriceDetail getUsagePriceDetail()
      Description copied from interface: PriceDetailComparable
      Represents the details related to a usage price including the units.
      Specified by:
      getUsagePriceDetail in interface PriceDetailComparable
      Returns:
      Represents the details related to a usage price including the units.
      Since:
      Pricing Client 2.0.3
      See Also:
    • getPriceList

      public PriceListRef getPriceList()
      See Also:
    • getPriceSource

      public String getPriceSource()
      The source of this price within the price list, e.g. price list formula, price list price data, etc.

      This may be helpful for consuming services to determine the priority of the price. For example, a price from DefaultPriceListPriceSources.BLC_PRICE_LIST_PRICE_DATA may have a higher precedence over DefaultPriceListPriceSources.BLC_PRICE_LIST_FORMULA.

      Since:
      1.4.1, 2.0.1
      See Also:
    • getActiveStartDate

      public Instant getActiveStartDate()
      Defines the beginning time for which this price is active.
      Since:
      Pricing Client 2.0.3
    • getActiveEndDate

      public Instant getActiveEndDate()
      Defines the ending time for which this price is active
      Since:
      Pricing Client 2.0.3
    • 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.
      Since:
      Pricing Client 2.0.3
    • getAvailableQuantity

      public Integer getAvailableQuantity()
      The available quantity that can use this price data. This is used for events such as a flash sale where the sale price is limited to a certain amount of quantity.
      Since:
      Pricing Client 2.0.3
    • getPriceType

      public String getPriceType()
      The originating type of this corresponding price.
    • getPriceDataTierList

      public List<PriceDataTierRef> getPriceDataTierList()
      See Also:
    • getPriority

      public Integer getPriority()
      Description copied from interface: PriceDetailComparable
      The relative priority of this price detail vs others that might apply to the same target.
      Specified by:
      getPriority in interface PriceDetailComparable
      Returns:
      The relative priority of this price detail vs others that might apply to the same target.
      Since:
      PricingService 2.0.3
      See Also:
    • getPriceListPriority

      public Integer getPriceListPriority()
      Description copied from interface: PriceDetailComparable
      The relative priority of the parent price list vs other price lists that may have price details with the same target.
      Specified by:
      getPriceListPriority in interface PriceDetailComparable
      Returns:
      The relative priority of the parent price list vs other price lists that may have price details with the same target.
      Since:
      Pricing Client 2.0.3
      See Also:
    • 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:
      2.0.4
    • 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 PRICE_DATA_FIELD, VARIANT_BASE_FIELD, or BASE_FIELD.
      Returns:
      Returns one of {"PRICE_DATA_FIELD", "VARIANT_BASE_FIELD", "BASE_FIELD", or null (representing none or unknown}
    • setPrice

      public void setPrice(javax.money.MonetaryAmount price)
      See Also:
    • setPaymentStrategy

      public void setPaymentStrategy(String paymentStrategy)
      Since:
      2.0.4
      See Also:
    • 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.

      Since:
      Pricing Client 2.0.3
    • setAdjustmentPriceDataId

      public void setAdjustmentPriceDataId(String adjustmentPriceDataId)
      If this price was modified by an adjustment PriceData record, stores the id of the adjustment PriceData.
      Since:
      Pricing Client 2.0.4
    • setAdjustmentPriceDataAmount

      public void setAdjustmentPriceDataAmount(javax.money.MonetaryAmount adjustmentPriceDataAmount)
      If this price was modified by an adjustment PriceData record, stores the amount of the adjustment.
      Since:
      Pricing Client 2.0.4
    • setAdjustmentPriceListId

      public void setAdjustmentPriceListId(String adjustmentPriceListId)
      If this price was modified by a price modifier from an Adjustment PriceList stores the id of the PriceList.
      Since:
      Pricing Client 2.0.4
    • setAdjustmentPriceListAmount

      public void setAdjustmentPriceListAmount(javax.money.MonetaryAmount adjustmentPriceListAmount)
      If this price was modified by a price modifier from an Adjustment PriceList stores the amount of the adjustment.
      Since:
      Pricing Client 2.0.4
    • setRecurringPriceDetail

      public void setRecurringPriceDetail(RecurringPriceDetail recurringPriceDetail)
      Since:
      Pricing Client 2.0.3
      See Also:
    • setUsagePriceDetail

      public void setUsagePriceDetail(UsagePriceDetail usagePriceDetail)
      Since:
      Pricing Client 2.0.3
      See Also:
    • setPriceList

      public void setPriceList(PriceListRef priceList)
      See Also:
    • 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.

      This may be helpful for consuming services to determine the priority of the price. For example, a price from DefaultPriceListPriceSources.BLC_PRICE_LIST_PRICE_DATA may have a higher precedence over DefaultPriceListPriceSources.BLC_PRICE_LIST_FORMULA.

      Since:
      1.4.1, 2.0.1
      See Also:
    • setActiveStartDate

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

      public void setActiveEndDate(Instant activeEndDate)
      Defines the ending time for which this price is active
      Since:
      Pricing Client 2.0.3
    • 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.
      Since:
      Pricing Client 2.0.3
    • setAvailableQuantity

      public void setAvailableQuantity(Integer availableQuantity)
      The available quantity that can use this price data. This is used for events such as a flash sale where the sale price is limited to a certain amount of quantity.
      Since:
      Pricing Client 2.0.3
    • setPriceType

      public void setPriceType(String priceType)
      The originating type of this corresponding price.
    • setPriceDataTierList

      public void setPriceDataTierList(List<PriceDataTierRef> priceDataTierList)
      See Also:
    • setPriority

      public void setPriority(Integer priority)
      Since:
      PricingService 2.0.3
      See Also:
    • setPriceListPriority

      public void setPriceListPriority(Integer priceListPriority)
      Since:
      Pricing Client 2.0.3
      See Also:
    • 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:
      2.0.4
    • 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 PRICE_DATA_FIELD, VARIANT_BASE_FIELD, or BASE_FIELD.
      Parameters:
      derivedFromField - The type of field used in formula based pricing
    • 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