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
Constructors -
Method Summary
Modifier and TypeMethodDescriptionintcompareTo(ProductDiscount productDiscount) Gets the discount amount as string, with '%' sign at the end indicating discount is given in percent.voidsetAmountFix(BigDecimal amountFix) voidsetAmountPercent(BigDecimal amountPercent) voidsetCurrency(String currency) voidsetProduct(Product product) voidsetStringAmount(String amount) Sets the discount amount from string, '%' sign at the end indicates discount is provided in percent.voidsetTotalPrice(BigDecimal totalPrice) toString()
-
Constructor Details
-
ProductDiscountImpl
public ProductDiscountImpl()
-
-
Method Details
-
setProduct
- Specified by:
setProductin interfaceProductDiscount
-
getProduct
- Specified by:
getProductin interfaceProductDiscount
-
setTotalPrice
- Specified by:
setTotalPricein interfaceProductDiscount
-
getTotalPrice
- Specified by:
getTotalPricein interfaceProductDiscount
-
setCurrency
- Specified by:
setCurrencyin interfaceProductDiscount
-
getCurrency
- Specified by:
getCurrencyin interfaceProductDiscount
-
setAmountFix
- Specified by:
setAmountFixin interfaceProductDiscount
-
getAmountFix
- Specified by:
getAmountFixin interfaceProductDiscount
-
setAmountPercent
- Specified by:
setAmountPercentin interfaceProductDiscount
-
getAmountPercent
- Specified by:
getAmountPercentin 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:
compareToin interfaceComparable<ProductDiscount>
-