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:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description PriceDataTier()
PriceDataTier(Integer minQuantity, javax.money.MonetaryAmount price, com.broadleafcommerce.data.tracking.core.EmbeddedContextState contextState)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected boolean
canEqual(Object other)
int
compareTo(PriceDataTier that)
Compares priorities.boolean
equals(Object o)
com.broadleafcommerce.data.tracking.core.EmbeddedContextState
getContextState()
A subset ofTracking
information to expose the context state for this object.Integer
getMinQuantity()
The quantity that defines the minimum threshold of this tier.javax.money.MonetaryAmount
getPrice()
The price for targets items when this tier is met.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.String
toString()
-
-
-
Constructor Detail
-
PriceDataTier
public PriceDataTier(Integer minQuantity, javax.money.MonetaryAmount price, com.broadleafcommerce.data.tracking.core.EmbeddedContextState contextState)
-
PriceDataTier
public PriceDataTier()
-
-
Method Detail
-
compareTo
public int compareTo(@NonNull PriceDataTier that)
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.
-
getMinQuantity
public Integer 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.
-
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
public void setMinQuantity(Integer minQuantity)
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.
-
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
-
canEqual
protected boolean canEqual(Object other)
-
-