Subversion Repositories SmartDukaan

Rev

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

Rev Author Line No. Line
27657 amit.gupta 1
package com.spice.profitmandi.service.offers;
2
 
3
import java.util.List;
4
 
5
public class ItemCriteria {
6
	private int id;
7
    private float startPrice;
8
    private float endPrice;
9
    private List<Integer> catalogIds;
10
    private List<Integer> excludeCatalogIds;
28019 amit.gupta 11
    private boolean smartPhone;
12
    private boolean featuredPhone;
27657 amit.gupta 13
    private List<String> brands;
29785 amit.gupta 14
    private List<Integer> itemIds;
27657 amit.gupta 15
 
16
    public List<Integer> getExcludeCatalogIds() {
17
		return excludeCatalogIds;
18
	}
19
 
20
 
21
 
22
	public void setExcludeCatalogIds(List<Integer> excludeCatalogIds) {
23
		this.excludeCatalogIds = excludeCatalogIds;
24
	}
25
 
26
	public float getStartPrice() {
27
        return startPrice;
28
    }
29
 
30
 
29785 amit.gupta 31
    public List<Integer> getItemIds() {
32
		return itemIds;
33
	}
27657 amit.gupta 34
 
29785 amit.gupta 35
	public void setItemIds(List<Integer> itemIds) {
36
		this.itemIds = itemIds;
37
	}
38
 
39
 
40
 
41
	public int getId() {
27657 amit.gupta 42
		return id;
43
	}
44
 
45
	public void setId(int id) {
46
		this.id = id;
47
	}
48
 
49
	public void setStartPrice(float startPrice) {
50
        this.startPrice = startPrice;
51
    }
52
 
53
 
54
    public float getEndPrice() {
55
        return endPrice;
56
    }
57
 
58
 
59
    public void setEndPrice(float endPrice) {
60
        this.endPrice = endPrice;
61
    }
62
 
63
 
64
    public List<Integer> getCatalogIds() {
65
        return catalogIds;
66
    }
67
 
68
 
69
    public void setCatalogIds(List<Integer> catalogIds) {
70
        this.catalogIds = catalogIds;
71
    }
72
 
28019 amit.gupta 73
    public List<String> getBrands() {
74
        return brands;
75
    }
27657 amit.gupta 76
 
28019 amit.gupta 77
 
27657 amit.gupta 78
    public boolean isSmartPhone() {
28019 amit.gupta 79
		return smartPhone;
80
	}
27657 amit.gupta 81
 
82
 
83
 
28019 amit.gupta 84
	public void setSmartPhone(boolean smartPhone) {
85
		this.smartPhone = smartPhone;
86
	}
27657 amit.gupta 87
 
88
 
89
 
28019 amit.gupta 90
	public boolean isFeaturedPhone() {
91
		return featuredPhone;
92
	}
27657 amit.gupta 93
 
94
 
95
 
28019 amit.gupta 96
	public void setFeaturedPhone(boolean featuredPhone) {
97
		this.featuredPhone = featuredPhone;
98
	}
27657 amit.gupta 99
 
28019 amit.gupta 100
 
101
 
102
	public void setBrands(List<String> brands) {
27657 amit.gupta 103
        this.brands = brands;
104
    }
105
 
106
 
107
    @Override
108
	public String toString() {
109
		return "ItemCriteria [id=" + id + ", startPrice=" + startPrice + ", endPrice=" + endPrice + ", catalogIds="
28019 amit.gupta 110
				+ catalogIds + ", excludeCatalogIds=" + excludeCatalogIds + ", smartPhone=" + smartPhone
29785 amit.gupta 111
				+ ", featuredPhone=" + featuredPhone + ", brands=" + brands + ", itemIds=" + itemIds + "]";
27657 amit.gupta 112
	}
113
 
114
 
115
    @Override
116
	public int hashCode() {
117
		final int prime = 31;
118
		int result = 1;
119
		result = prime * result + ((brands == null) ? 0 : brands.hashCode());
120
		result = prime * result + ((catalogIds == null) ? 0 : catalogIds.hashCode());
121
		result = prime * result + Float.floatToIntBits(endPrice);
122
		result = prime * result + ((excludeCatalogIds == null) ? 0 : excludeCatalogIds.hashCode());
28019 amit.gupta 123
		result = prime * result + (featuredPhone ? 1231 : 1237);
27657 amit.gupta 124
		result = prime * result + id;
29785 amit.gupta 125
		result = prime * result + ((itemIds == null) ? 0 : itemIds.hashCode());
28019 amit.gupta 126
		result = prime * result + (smartPhone ? 1231 : 1237);
27657 amit.gupta 127
		result = prime * result + Float.floatToIntBits(startPrice);
128
		return result;
129
	}
130
 
131
 
132
    @Override
133
	public boolean equals(Object obj) {
134
		if (this == obj)
135
			return true;
136
		if (obj == null)
137
			return false;
138
		if (getClass() != obj.getClass())
139
			return false;
140
		ItemCriteria other = (ItemCriteria) obj;
141
		if (brands == null) {
142
			if (other.brands != null)
143
				return false;
144
		} else if (!brands.equals(other.brands))
145
			return false;
146
		if (catalogIds == null) {
147
			if (other.catalogIds != null)
148
				return false;
149
		} else if (!catalogIds.equals(other.catalogIds))
150
			return false;
151
		if (Float.floatToIntBits(endPrice) != Float.floatToIntBits(other.endPrice))
152
			return false;
153
		if (excludeCatalogIds == null) {
154
			if (other.excludeCatalogIds != null)
155
				return false;
156
		} else if (!excludeCatalogIds.equals(other.excludeCatalogIds))
157
			return false;
28019 amit.gupta 158
		if (featuredPhone != other.featuredPhone)
159
			return false;
27657 amit.gupta 160
		if (id != other.id)
161
			return false;
29785 amit.gupta 162
		if (itemIds == null) {
163
			if (other.itemIds != null)
164
				return false;
165
		} else if (!itemIds.equals(other.itemIds))
166
			return false;
28019 amit.gupta 167
		if (smartPhone != other.smartPhone)
27657 amit.gupta 168
			return false;
169
		if (Float.floatToIntBits(startPrice) != Float.floatToIntBits(other.startPrice))
170
			return false;
171
		return true;
172
	}
173
 
174
 
175
}