Class PriceDataTier
java.lang.Object
com.broadleafcommerce.pricing.domain.PriceDataTier
- All Implemented Interfaces:
com.broadleafcommerce.data.tracking.core.EmbeddedContextStateAware
,Serializable
,Comparable<PriceDataTier>
public class PriceDataTier
extends Object
implements Serializable, Comparable<PriceDataTier>, com.broadleafcommerce.data.tracking.core.EmbeddedContextStateAware
Specify a price depending on a minimum quantity being met. i.e. "Sku A" gets a reduced price if
you buy 5 of them, and a further reduced price if you buy 10.
- Author:
- Chad Harchar (charchar)
- See Also:
-
Field Summary
Fields inherited from interface com.broadleafcommerce.data.tracking.core.EmbeddedContextStateAware
DEFAULT_FIELD_NAME
-
Constructor Summary
ConstructorsConstructorDescriptionPriceDataTier
(Integer minQuantity, javax.money.MonetaryAmount price, com.broadleafcommerce.data.tracking.core.EmbeddedContextState contextState) -
Method Summary
Modifier and TypeMethodDescriptionint
compareTo
(PriceDataTier that) Compares priorities.boolean
com.broadleafcommerce.data.tracking.core.EmbeddedContextState
A subset ofTracking
information to expose the context state for this object.The quantity that defines the minimum threshold of this tier.javax.money.MonetaryAmount
getPrice()
The price for targets items when this tier is met.javax.money.MonetaryAmount
The amount of the recurring price.javax.money.MonetaryAmount
The amount of the usage price.int
hashCode()
void
setContextState
(com.broadleafcommerce.data.tracking.core.EmbeddedContextState contextState) A subset ofTracking
information to expose the context state for this object.void
setMinQuantity
(Integer minQuantity) The quantity that defines the minimum threshold of this tier.void
setPrice
(javax.money.MonetaryAmount price) The price for targets items when this tier is met.void
setRecurringPrice
(javax.money.MonetaryAmount recurringPrice) The amount of the recurring price.void
setUsagePrice
(javax.money.MonetaryAmount usagePrice) The amount of the usage price.toString()
-
Constructor Details
-
PriceDataTier
public PriceDataTier(Integer minQuantity, javax.money.MonetaryAmount price, @Nullable com.broadleafcommerce.data.tracking.core.EmbeddedContextState contextState) -
PriceDataTier
public PriceDataTier()
-
-
Method Details
-
compareTo
Compares priorities. Null is less than non-null.- Specified by:
compareTo
in interfaceComparable<PriceDataTier>
- Parameters:
that
- PriceDataTier to which we are comparing- Returns:
- a negative integer, zero, or a positive integer as this object is less than, equal to, or greater than the specified object.
-
equals
-
hashCode
public int hashCode() -
getMinQuantity
The quantity that defines the minimum threshold of this tier. -
getPrice
public javax.money.MonetaryAmount getPrice()The price for targets items when this tier is met. -
getRecurringPrice
public javax.money.MonetaryAmount getRecurringPrice()The amount of the recurring price. Optional.- Since:
- Pricing Service 2.1.0, Release Train 2.2.0
-
getUsagePrice
public javax.money.MonetaryAmount getUsagePrice()The amount of the usage price. Optional.- Since:
- Pricing Service 2.1.0, Release Train 2.2.0
-
getContextState
public com.broadleafcommerce.data.tracking.core.EmbeddedContextState getContextState()A subset ofTracking
information to expose the context state for this object. This value is not persisted, and instead it is dynamically calculated and populated when theChangeDetails
for the parent object's entireattributes
map are compared.- Specified by:
getContextState
in interfacecom.broadleafcommerce.data.tracking.core.EmbeddedContextStateAware
- Returns:
- a subset of
Tracking
information to expose the context state for this object
-
setMinQuantity
The quantity that defines the minimum threshold of this tier. -
setPrice
public void setPrice(javax.money.MonetaryAmount price) The price for targets items when this tier is met. -
setRecurringPrice
public void setRecurringPrice(javax.money.MonetaryAmount recurringPrice) The amount of the recurring price. Optional.- 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.- Since:
- Pricing Service 2.1.0, Release Train 2.2.0
-
setContextState
public void setContextState(com.broadleafcommerce.data.tracking.core.EmbeddedContextState contextState) A subset ofTracking
information to expose the context state for this object. This value is not persisted, and instead it is dynamically calculated and populated when theChangeDetails
for the parent object's entireattributes
map are compared.- Specified by:
setContextState
in interfacecom.broadleafcommerce.data.tracking.core.EmbeddedContextStateAware
- Parameters:
contextState
- a subset ofTracking
information to expose the context state for this object
-
toString
-