Subversion Repositories SmartDukaan

Rev

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

Rev 23417 Rev 32816
Line 1... Line 1...
1
package com.spice.profitmandi.common.model;
1
package com.spice.profitmandi.common.model;
2
 
2
 
-
 
3
import java.util.List;
-
 
4
import java.util.Objects;
3
import java.util.Set;
5
import java.util.Set;
4
 
6
 
5
public class CustomFofoOrderItem {
7
public class CustomFofoOrderItem {
6
	private int itemId;
8
	private int itemId;
-
 
9
	private List<String> customSerialNumbers;
7
	private int quantity;
10
	private int quantity;
8
	private float sellingPrice;
11
	private float sellingPrice;
9
	private float discountAmount;
12
	private float discountAmount;
10
	private boolean prebookingOrder;
13
	private boolean prebookingOrder;
11
	private Set<SerialNumberDetail> serialNumberDetails;
14
	private Set<SerialNumberDetail> serialNumberDetails;
Line 44... Line 47...
44
		return serialNumberDetails;
47
		return serialNumberDetails;
45
	}
48
	}
46
	public void setSerialNumberDetails(Set<SerialNumberDetail> serialNumberDetails) {
49
	public void setSerialNumberDetails(Set<SerialNumberDetail> serialNumberDetails) {
47
		this.serialNumberDetails = serialNumberDetails;
50
		this.serialNumberDetails = serialNumberDetails;
48
	}
51
	}
49
	
52
 
50
	@Override
53
	@Override
51
	public int hashCode() {
54
	public String toString() {
52
		final int prime = 31;
55
		return "CustomFofoOrderItem{" +
53
		int result = 1;
56
				"itemId=" + itemId +
54
		result = prime * result + Float.floatToIntBits(discountAmount);
57
				", customSerialNumbers=" + customSerialNumbers +
55
		result = prime * result + itemId;
58
				", quantity=" + quantity +
56
		result = prime * result + (prebookingOrder ? 1231 : 1237);
59
				", sellingPrice=" + sellingPrice +
57
		result = prime * result + quantity;
60
				", discountAmount=" + discountAmount +
58
		result = prime * result + Float.floatToIntBits(sellingPrice);
61
				", prebookingOrder=" + prebookingOrder +
59
		result = prime * result + ((serialNumberDetails == null) ? 0 : serialNumberDetails.hashCode());
62
				", serialNumberDetails=" + serialNumberDetails +
60
		return result;
63
				'}';
61
	}
64
	}
62
	
65
 
63
	@Override
66
	@Override
64
	public boolean equals(Object obj) {
67
	public boolean equals(Object o) {
65
		if (this == obj)
68
		if (this == o) return true;
66
			return true;
-
 
67
		if (obj == null)
-
 
68
			return false;
-
 
69
		if (getClass() != obj.getClass())
69
		if (o == null || getClass() != o.getClass()) return false;
70
			return false;
-
 
71
		CustomFofoOrderItem other = (CustomFofoOrderItem) obj;
70
		CustomFofoOrderItem that = (CustomFofoOrderItem) o;
72
		if (Float.floatToIntBits(discountAmount) != Float.floatToIntBits(other.discountAmount))
71
		return itemId == that.itemId && quantity == that.quantity && Float.compare(sellingPrice, that.sellingPrice) == 0 && Float.compare(discountAmount, that.discountAmount) == 0 && prebookingOrder == that.prebookingOrder && Objects.equals(customSerialNumbers, that.customSerialNumbers) && Objects.equals(serialNumberDetails, that.serialNumberDetails);
73
			return false;
-
 
74
		if (itemId != other.itemId)
-
 
75
			return false;
-
 
76
		if (prebookingOrder != other.prebookingOrder)
-
 
77
			return false;
-
 
78
		if (quantity != other.quantity)
-
 
79
			return false;
-
 
80
		if (Float.floatToIntBits(sellingPrice) != Float.floatToIntBits(other.sellingPrice))
-
 
81
			return false;
-
 
82
		if (serialNumberDetails == null) {
-
 
83
			if (other.serialNumberDetails != null)
-
 
84
				return false;
-
 
85
		} else if (!serialNumberDetails.equals(other.serialNumberDetails))
-
 
86
			return false;
-
 
87
		return true;
-
 
88
	}
72
	}
89
	
73
 
90
	@Override
74
	@Override
91
	public String toString() {
75
	public int hashCode() {
92
		return "CustomFofoOrderItem [itemId=" + itemId + ", quantity=" + quantity + ", sellingPrice=" + sellingPrice
76
		return Objects.hash(itemId, customSerialNumbers, quantity, sellingPrice, discountAmount, prebookingOrder, serialNumberDetails);
93
				+ ", discountAmount=" + discountAmount + ", prebookingOrder=" + prebookingOrder
-
 
94
				+ ", serialNumberDetails=" + serialNumberDetails + "]";
-
 
95
	}
77
	}
-
 
78
 
-
 
79
	public List<String> getCustomSerialNumbers() {
-
 
80
		return customSerialNumbers;
96
	
81
	}
-
 
82
 
-
 
83
	public void setCustomSerialNumbers(List<String> customSerialNumbers) {
-
 
84
		this.customSerialNumbers = customSerialNumbers;
-
 
85
	}
-
 
86
 
97
}
87
}