Subversion Repositories SmartDukaan

Rev

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

Rev 21614 Rev 21923
Line 48... Line 48...
48
		return displayName;
48
		return displayName;
49
	}
49
	}
50
	public void setDisplayName(String displayName) {
50
	public void setDisplayName(String displayName) {
51
		this.displayName = displayName;
51
		this.displayName = displayName;
52
	}
52
	}
-
 
53
	
-
 
54
	
-
 
55
	@Override
-
 
56
	public int hashCode() {
-
 
57
		final int prime = 31;
-
 
58
		int result = 1;
-
 
59
		result = prime * result + ((brand == null) ? 0 : brand.hashCode());
-
 
60
		result = prime * result + ((color == null) ? 0 : color.hashCode());
-
 
61
		result = prime * result + ((displayName == null) ? 0 : displayName.hashCode());
-
 
62
		result = prime * result + ((modelName == null) ? 0 : modelName.hashCode());
-
 
63
		result = prime * result + ((modelNumber == null) ? 0 : modelNumber.hashCode());
-
 
64
		result = prime * result + Float.floatToIntBits(quantity);
-
 
65
		result = prime * result + Float.floatToIntBits(unitPrice);
-
 
66
		return result;
-
 
67
	}
-
 
68
	@Override
-
 
69
	public boolean equals(Object obj) {
-
 
70
		if (this == obj)
-
 
71
			return true;
-
 
72
		if (obj == null)
-
 
73
			return false;
-
 
74
		if (getClass() != obj.getClass())
-
 
75
			return false;
-
 
76
		CustomLineItem other = (CustomLineItem) obj;
-
 
77
		if (brand == null) {
-
 
78
			if (other.brand != null)
-
 
79
				return false;
-
 
80
		} else if (!brand.equals(other.brand))
-
 
81
			return false;
-
 
82
		if (color == null) {
-
 
83
			if (other.color != null)
-
 
84
				return false;
-
 
85
		} else if (!color.equals(other.color))
-
 
86
			return false;
-
 
87
		if (displayName == null) {
-
 
88
			if (other.displayName != null)
-
 
89
				return false;
-
 
90
		} else if (!displayName.equals(other.displayName))
-
 
91
			return false;
-
 
92
		if (modelName == null) {
-
 
93
			if (other.modelName != null)
-
 
94
				return false;
-
 
95
		} else if (!modelName.equals(other.modelName))
-
 
96
			return false;
-
 
97
		if (modelNumber == null) {
-
 
98
			if (other.modelNumber != null)
-
 
99
				return false;
-
 
100
		} else if (!modelNumber.equals(other.modelNumber))
-
 
101
			return false;
-
 
102
		if (Float.floatToIntBits(quantity) != Float.floatToIntBits(other.quantity))
-
 
103
			return false;
-
 
104
		if (Float.floatToIntBits(unitPrice) != Float.floatToIntBits(other.unitPrice))
-
 
105
			return false;
-
 
106
		return true;
-
 
107
	}
53
	@Override
108
	@Override
54
	public String toString() {
109
	public String toString() {
55
		return "CustomLineItem [brand=" + brand + ", modelName=" + modelName + ", modelNumber=" + modelNumber
110
		return "CustomLineItem [brand=" + brand + ", modelName=" + modelName + ", modelNumber=" + modelNumber
56
				+ ", color=" + color + ", quantity=" + quantity + ", unitPrice=" + unitPrice + "]";
111
				+ ", color=" + color + ", quantity=" + quantity + ", unitPrice=" + unitPrice + "]";
57
	}
112
	}