Class ProductDiscountImpl
java.lang.Object
com.labs64.netlicensing.domain.entity.impl.ProductDiscountImpl
- All Implemented Interfaces:
ProductDiscount
,Serializable
,Comparable<ProductDiscount>
Represents discount step as a discount amount (absolute or percentage) after total price reaches the given threshold.
- See Also:
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionint
compareTo
(ProductDiscount productDiscount) Gets the discount amount as string, with '%' sign at the end indicating discount is given in percent.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) toString()
-
Constructor Details
-
ProductDiscountImpl
public ProductDiscountImpl()
-
-
Method Details
-
setProduct
- Specified by:
setProduct
in interfaceProductDiscount
-
getProduct
- Specified by:
getProduct
in interfaceProductDiscount
-
setTotalPrice
- Specified by:
setTotalPrice
in interfaceProductDiscount
-
getTotalPrice
- Specified by:
getTotalPrice
in interfaceProductDiscount
-
setCurrency
- Specified by:
setCurrency
in interfaceProductDiscount
-
getCurrency
- Specified by:
getCurrency
in interfaceProductDiscount
-
setAmountFix
- Specified by:
setAmountFix
in interfaceProductDiscount
-
getAmountFix
- Specified by:
getAmountFix
in interfaceProductDiscount
-
setAmountPercent
- Specified by:
setAmountPercent
in interfaceProductDiscount
-
getAmountPercent
- Specified by:
getAmountPercent
in interfaceProductDiscount
-
getStringAmount
Gets the discount amount as string, with '%' sign at the end indicating discount is given in percent.- Returns:
- the string amount
-
setStringAmount
Sets the discount amount from string, '%' sign at the end indicates discount is provided in percent.- Parameters:
amount
- discount amount as string
-
toString
-
compareTo
- Specified by:
compareTo
in interfaceComparable<ProductDiscount>
-