Subversion Repositories SmartDukaan

Rev

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