-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathProduct.java
67 lines (58 loc) · 1.8 KB
/
Product.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
package api.model;
import java.io.Serializable;
import java.util.Objects;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlRootElement;
@XmlRootElement(name = "product")
public class Product implements Serializable {
private static final long serialVersionUID = 1L;
private String id = null;
private String name = null;
private String description = null;
private String category = null;
private String vendor = null;
private int quantity = -1;
private double cost = -1;
private double msrp = -1;
public Product() { }
public String getId() {
return id; }
public String getName() {
return name; }
public String getDescription() {
return description; }
public String getCategory() {
return category; }
public String getVendor() {
return vendor; }
public int getQuantity() {
return quantity; }
public double getCost() {
return cost; }
@XmlElement(name = "msrp")
public double getMSRP() {
return msrp; }
public void setId(String id) {
this.id = id; }
public void setName(String name) {
this.name = name; }
public void setDescription(String description) {
this.description = description; }
public void setCategory(String category) {
this.category = category; }
public void setVendor(String vendor) {
this.vendor = vendor; }
public void setQuantity(int quantity) {
this.quantity = quantity; }
public void setCost(double cost) {
this.cost = cost; }
public void setMSRP(double msrp) {
this.msrp = msrp; }
@Override
public boolean equals(Object other) {
if (this == other) return true;
if (other == null) return false;
if (!(other instanceof Product)) return false;
return Objects.equals(getId(), ((Product)other).getId());
}
}