1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. /**
  2. * Created by leon on 1/10/18.
  3. */
  4. public class Product {
  5. private double price;
  6. private int quantity;
  7. private int id;
  8. public Product(){}
  9. public Product(int productId, double price,int quantity){
  10. this.id = id;
  11. this.price = price;
  12. this.quantity = quantity;
  13. }
  14. public void setPrice(double newPrice) {
  15. this.price = newPrice;
  16. }
  17. public double getPrice() {
  18. return price;
  19. }
  20. public void setQuantity(int newQuantity){
  21. this.quantity = newQuantity;
  22. }
  23. public int getQuantity() {
  24. return quantity;
  25. }
  26. public void setId(int productId) {
  27. this.id = productId;
  28. }
  29. public int getId() {
  30. return id;
  31. }
  32. public String toString() {
  33. return Integer.toString(id) + " - " + price + " - " + quantity;
  34. }
  35. }