Subversion Repositories SmartDukaan

Rev

Rev 25953 | Rev 28653 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
26607 amit.gupta 1
package com.spice.profitmandi.dao.model;
21378 kshitij.so 2
 
26607 amit.gupta 3
public class CartItem
21378 kshitij.so 4
{	
26607 amit.gupta 5
 
6
	private long quantity;
7
	private int itemId;
8
	private double sellingPrice;
9
 
10
	public CartItem(long quantity, int itemId) {
25953 amit.gupta 11
		super();
12
		this.quantity = quantity;
13
		this.itemId = itemId;
14
	}
15
 
26607 amit.gupta 16
    public CartItem() {
25953 amit.gupta 17
    	super();
18
    }
19
 
21378 kshitij.so 20
    public long getQuantity() {
21
		return quantity;
22
	}
26607 amit.gupta 23
 
24
 
21378 kshitij.so 25
 
26607 amit.gupta 26
	@Override
27
	public int hashCode() {
28
		final int prime = 31;
29
		int result = 1;
30
		result = prime * result + itemId;
31
		result = prime * result + (int) (quantity ^ (quantity >>> 32));
32
		long temp;
33
		temp = Double.doubleToLongBits(sellingPrice);
34
		result = prime * result + (int) (temp ^ (temp >>> 32));
35
		return result;
36
	}
37
 
38
	@Override
39
	public boolean equals(Object obj) {
40
		if (this == obj)
41
			return true;
42
		if (obj == null)
43
			return false;
44
		if (getClass() != obj.getClass())
45
			return false;
46
		CartItem other = (CartItem) obj;
47
		if (itemId != other.itemId)
48
			return false;
49
		if (quantity != other.quantity)
50
			return false;
51
		if (Double.doubleToLongBits(sellingPrice) != Double.doubleToLongBits(other.sellingPrice))
52
			return false;
53
		return true;
54
	}
55
 
56
	public double getSellingPrice() {
57
		return sellingPrice;
58
	}
59
 
60
	public void setSellingPrice(double sellingPrice) {
61
		this.sellingPrice = sellingPrice;
62
	}
63
 
21378 kshitij.so 64
	public void setQuantity(long quantity) {
65
		this.quantity = quantity;
66
	}
67
 
68
	public int getItemId() {
69
		return itemId;
70
	}
71
 
72
	public void setItemId(int itemId) {
73
		this.itemId = itemId;
74
	}
75
 
76
	@Override
77
	public String toString() {
26607 amit.gupta 78
		return "CartItem [quantity=" + quantity + ", itemId=" + itemId + ", sellingPrice=" + sellingPrice + "]";
21378 kshitij.so 79
	}
80
 
81
}