Subversion Repositories SmartDukaan

Rev

Rev 32698 | Rev 33436 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 32698 Rev 33399
Line 6... Line 6...
6
{	
6
{	
7
	
7
	
8
	private int quantity;
8
	private int quantity;
9
	private int itemId;
9
	private int itemId;
10
	private double sellingPrice;
10
	private double sellingPrice;
-
 
11
	private double extendedWarrantyPrice;
11
	private int availability;
12
	private int availability;
12
	private int warehouseId;
13
	private int warehouseId;
13
 
14
 
14
	public CartItem(int quantity, int itemId) {
15
	public CartItem(int quantity, int itemId) {
15
		super();
16
		super();
Line 28... Line 29...
28
	@Override
29
	@Override
29
	public boolean equals(Object o) {
30
	public boolean equals(Object o) {
30
		if (this == o) return true;
31
		if (this == o) return true;
31
		if (o == null || getClass() != o.getClass()) return false;
32
		if (o == null || getClass() != o.getClass()) return false;
32
		CartItem cartItem = (CartItem) o;
33
		CartItem cartItem = (CartItem) o;
33
		return quantity == cartItem.quantity && itemId == cartItem.itemId && Double.compare(cartItem.sellingPrice, sellingPrice) == 0 && availability == cartItem.availability;
34
		return quantity == cartItem.quantity && itemId == cartItem.itemId && Double.compare(cartItem.sellingPrice, sellingPrice) == 0 && Double.compare(cartItem.extendedWarrantyPrice, extendedWarrantyPrice) == 0 && availability == cartItem.availability;
34
	}
35
	}
35
 
36
 
36
	@Override
37
	@Override
37
	public int hashCode() {
38
	public int hashCode() {
38
		return Objects.hash(quantity, itemId, sellingPrice, availability);
39
		return Objects.hash(quantity, itemId, sellingPrice, extendedWarrantyPrice, availability);
39
	}
40
	}
40
 
41
 
41
	@Override
42
	@Override
42
	public String toString() {
43
	public String toString() {
43
		return "CartItem{" +
44
		return "CartItem{" +
44
				"quantity=" + quantity +
45
				"quantity=" + quantity +
45
				", itemId=" + itemId +
46
				", itemId=" + itemId +
46
				", sellingPrice=" + sellingPrice +
47
				", sellingPrice=" + sellingPrice +
-
 
48
				", extendedWarrantyPrice=" + extendedWarrantyPrice +
47
				", availability=" + availability +
49
				", availability=" + availability +
48
				'}';
50
				'}';
49
	}
51
	}
50
 
52
 
51
	public int getAvailability() {
53
	public int getAvailability() {
Line 78... Line 80...
78
 
80
 
79
	public int getWarehouseId() {
81
	public int getWarehouseId() {
80
		return warehouseId;
82
		return warehouseId;
81
	}
83
	}
82
 
84
 
-
 
85
	public double getExtendedWarrantyPrice() {
-
 
86
		return extendedWarrantyPrice;
-
 
87
	}
-
 
88
 
-
 
89
	public void setExtendedWarrantyPrice(double extendedWarrantyPrice) {
-
 
90
		this.extendedWarrantyPrice = extendedWarrantyPrice;
-
 
91
	}
-
 
92
 
83
	public void setWarehouseId(int warehouseId) {
93
	public void setWarehouseId(int warehouseId) {
84
		this.warehouseId = warehouseId;
94
		this.warehouseId = warehouseId;
85
	}
95
	}
86
}
96
}
87
97