Product.java 695 B

12345678910111213141516171819202122232425262728293031323334353637383940
  1. package J20250724.demo01;
  2. /**
  3. * @author WanJl
  4. * @version 1.0
  5. * @title Product
  6. * @description
  7. * @create 2025/7/24
  8. */
  9. public abstract class Product {
  10. private Integer id;
  11. private String name;
  12. private Double price;
  13. public Integer getId() {
  14. return id;
  15. }
  16. public void setId(Integer id) {
  17. this.id = id;
  18. }
  19. public String getName() {
  20. return name;
  21. }
  22. public void setName(String name) {
  23. this.name = name;
  24. }
  25. public Double getPrice() {
  26. return price;
  27. }
  28. public void setPrice(Double price) {
  29. this.price = price;
  30. }
  31. public abstract double getDiscountPrice() throws InvalidPriceException;
  32. }