Class ProductDiscountImpl
- java.lang.Object
-
- com.labs64.netlicensing.domain.entity.impl.ProductDiscountImpl
-
- All Implemented Interfaces:
ProductDiscount
,Serializable
,Comparable<ProductDiscount>
public class ProductDiscountImpl extends Object implements ProductDiscount, Serializable
Represents discount step as a discount amount (absolute or percentage) after total price reaches the given threshold.- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description ProductDiscountImpl()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description int
compareTo(ProductDiscount productDiscount)
BigDecimal
getAmountFix()
BigDecimal
getAmountPercent()
String
getCurrency()
Product
getProduct()
String
getStringAmount()
Gets the discount amount as string, with '%' sign at the end indicating discount is given in percent.BigDecimal
getTotalPrice()
void
setAmountFix(BigDecimal amountFix)
void
setAmountPercent(BigDecimal amountPercent)
void
setCurrency(String currency)
void
setProduct(Product product)
void
setStringAmount(String amount)
Sets the discount amount from string, '%' sign at the end indicates discount is provided in percent.void
setTotalPrice(BigDecimal totalPrice)
String
toString()
-
-
-
Method Detail
-
setProduct
public void setProduct(Product product)
- Specified by:
setProduct
in interfaceProductDiscount
-
getProduct
public Product getProduct()
- Specified by:
getProduct
in interfaceProductDiscount
-
setTotalPrice
public void setTotalPrice(BigDecimal totalPrice)
- Specified by:
setTotalPrice
in interfaceProductDiscount
-
getTotalPrice
public BigDecimal getTotalPrice()
- Specified by:
getTotalPrice
in interfaceProductDiscount
-
setCurrency
public void setCurrency(String currency)
- Specified by:
setCurrency
in interfaceProductDiscount
-
getCurrency
public String getCurrency()
- Specified by:
getCurrency
in interfaceProductDiscount
-
setAmountFix
public void setAmountFix(BigDecimal amountFix)
- Specified by:
setAmountFix
in interfaceProductDiscount
-
getAmountFix
public BigDecimal getAmountFix()
- Specified by:
getAmountFix
in interfaceProductDiscount
-
setAmountPercent
public void setAmountPercent(BigDecimal amountPercent)
- Specified by:
setAmountPercent
in interfaceProductDiscount
-
getAmountPercent
public BigDecimal getAmountPercent()
- Specified by:
getAmountPercent
in interfaceProductDiscount
-
getStringAmount
public String getStringAmount()
Gets the discount amount as string, with '%' sign at the end indicating discount is given in percent.- Returns:
- the string amount
-
setStringAmount
public void setStringAmount(String amount)
Sets the discount amount from string, '%' sign at the end indicates discount is provided in percent.- Parameters:
amount
- discount amount as string
-
compareTo
public int compareTo(ProductDiscount productDiscount)
- Specified by:
compareTo
in interfaceComparable<ProductDiscount>
-
-