Subversion Repositories SmartDukaan

Rev

Rev 28019 | Go to most recent revision | Details | 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;
11
    private boolean isSmartPhone;
12
    private boolean isFeaturedPhone;
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
 
66
 
67
    public boolean isSmartPhone() {
68
        return isSmartPhone;
69
    }
70
 
71
 
72
    public void setSmartPhone(boolean isSmartPhone) {
73
        this.isSmartPhone = isSmartPhone;
74
    }
75
 
76
 
77
    public boolean isFeaturedPhone() {
78
        return isFeaturedPhone;
79
    }
80
 
81
 
82
    public void setFeaturedPhone(boolean isFeaturedPhone) {
83
        this.isFeaturedPhone = isFeaturedPhone;
84
    }
85
 
86
 
87
    public List<String> getBrands() {
88
        return brands;
89
    }
90
 
91
 
92
    public void setBrands(List<String> brands) {
93
        this.brands = brands;
94
    }
95
 
96
 
97
    @Override
98
	public String toString() {
99
		return "ItemCriteria [id=" + id + ", startPrice=" + startPrice + ", endPrice=" + endPrice + ", catalogIds="
100
				+ catalogIds + ", excludeCatalogIds=" + excludeCatalogIds + ", isSmartPhone=" + isSmartPhone
101
				+ ", isFeaturedPhone=" + isFeaturedPhone + ", brands=" + brands + "]";
102
	}
103
 
104
 
105
    @Override
106
	public int hashCode() {
107
		final int prime = 31;
108
		int result = 1;
109
		result = prime * result + ((brands == null) ? 0 : brands.hashCode());
110
		result = prime * result + ((catalogIds == null) ? 0 : catalogIds.hashCode());
111
		result = prime * result + Float.floatToIntBits(endPrice);
112
		result = prime * result + ((excludeCatalogIds == null) ? 0 : excludeCatalogIds.hashCode());
113
		result = prime * result + id;
114
		result = prime * result + (isFeaturedPhone ? 1231 : 1237);
115
		result = prime * result + (isSmartPhone ? 1231 : 1237);
116
		result = prime * result + Float.floatToIntBits(startPrice);
117
		return result;
118
	}
119
 
120
 
121
    @Override
122
	public boolean equals(Object obj) {
123
		if (this == obj)
124
			return true;
125
		if (obj == null)
126
			return false;
127
		if (getClass() != obj.getClass())
128
			return false;
129
		ItemCriteria other = (ItemCriteria) obj;
130
		if (brands == null) {
131
			if (other.brands != null)
132
				return false;
133
		} else if (!brands.equals(other.brands))
134
			return false;
135
		if (catalogIds == null) {
136
			if (other.catalogIds != null)
137
				return false;
138
		} else if (!catalogIds.equals(other.catalogIds))
139
			return false;
140
		if (Float.floatToIntBits(endPrice) != Float.floatToIntBits(other.endPrice))
141
			return false;
142
		if (excludeCatalogIds == null) {
143
			if (other.excludeCatalogIds != null)
144
				return false;
145
		} else if (!excludeCatalogIds.equals(other.excludeCatalogIds))
146
			return false;
147
		if (id != other.id)
148
			return false;
149
		if (isFeaturedPhone != other.isFeaturedPhone)
150
			return false;
151
		if (isSmartPhone != other.isSmartPhone)
152
			return false;
153
		if (Float.floatToIntBits(startPrice) != Float.floatToIntBits(other.startPrice))
154
			return false;
155
		return true;
156
	}
157
 
158
 
159
}