12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. /**
  2. * Created by leon on 1/10/18.
  3. */
  4. public class Product {
  5. private String name;
  6. private double price;
  7. private int id;
  8. private int quantity;
  9. public Product(){
  10. }
  11. public Product(String name, int id){
  12. this.id = id;
  13. this.name = name;
  14. }
  15. public Product(String name, double price, int id, int quantity){
  16. this.name = name;
  17. this.price = price;
  18. this.id = id;
  19. this.quantity = quantity;
  20. }
  21. public void setName(String newName){
  22. name = newName;
  23. }
  24. public String getName(){
  25. return name;
  26. }
  27. public void setPrice(double newPrice){
  28. price = newPrice;
  29. }
  30. public double getPrice(){
  31. return price;
  32. }
  33. public void setID(int newID){
  34. id = newID;
  35. }
  36. public int getID(){
  37. return id;
  38. }
  39. public void setQuantity(int newQuantity){
  40. quantity = newQuantity;
  41. }
  42. public int getQuantity(){
  43. return quantity;
  44. }
  45. }