Subversion Repositories SmartDukaan

Rev

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

Rev 29785 Rev 30755
Line 1... Line 1...
1
package com.spice.profitmandi.service.offers;
1
package com.spice.profitmandi.service.offers;
2
 
2
 
3
import java.util.List;
3
import java.util.List;
-
 
4
import java.util.Objects;
4
 
5
 
5
public class ItemCriteria {
6
public class ItemCriteria {
6
	private int id;
7
	private int id;
7
    private float startPrice;
8
    private float startPrice;
8
    private float endPrice;
9
    private float endPrice;
9
    private List<Integer> catalogIds;
10
    private List<Integer> catalogIds;
10
    private List<Integer> excludeCatalogIds;
11
    private List<Integer> excludeCatalogIds;
11
    private boolean smartPhone;
12
    private boolean smartPhone;
12
    private boolean featuredPhone;
13
	private boolean featuredPhone;
-
 
14
	private boolean led;
13
    private List<String> brands;
15
	private List<String> brands;
14
    private List<Integer> itemIds;
16
    private List<Integer> itemIds;
15
 
17
 
16
    public List<Integer> getExcludeCatalogIds() {
18
    public List<Integer> getExcludeCatalogIds() {
17
		return excludeCatalogIds;
19
		return excludeCatalogIds;
18
	}
20
	}
Line 102... Line 104...
102
	public void setBrands(List<String> brands) {
104
	public void setBrands(List<String> brands) {
103
        this.brands = brands;
105
        this.brands = brands;
104
    }
106
    }
105
 
107
 
106
 
108
 
107
    @Override
109
	@Override
108
	public String toString() {
110
	public String toString() {
-
 
111
		return "ItemCriteria{" +
-
 
112
				"id=" + id +
109
		return "ItemCriteria [id=" + id + ", startPrice=" + startPrice + ", endPrice=" + endPrice + ", catalogIds="
113
				", startPrice=" + startPrice +
-
 
114
				", endPrice=" + endPrice +
-
 
115
				", catalogIds=" + catalogIds +
110
				+ catalogIds + ", excludeCatalogIds=" + excludeCatalogIds + ", smartPhone=" + smartPhone
116
				", excludeCatalogIds=" + excludeCatalogIds +
-
 
117
				", smartPhone=" + smartPhone +
-
 
118
				", featuredPhone=" + featuredPhone +
-
 
119
				", led=" + led +
-
 
120
				", brands=" + brands +
-
 
121
				", itemIds=" + itemIds +
-
 
122
				'}';
-
 
123
	}
-
 
124
 
-
 
125
	@Override
-
 
126
	public boolean equals(Object o) {
-
 
127
		if (this == o) return true;
-
 
128
		if (o == null || getClass() != o.getClass()) return false;
-
 
129
		ItemCriteria that = (ItemCriteria) o;
111
				+ ", featuredPhone=" + featuredPhone + ", brands=" + brands + ", itemIds=" + itemIds + "]";
130
		return id == that.id && Float.compare(that.startPrice, startPrice) == 0 && Float.compare(that.endPrice, endPrice) == 0 && smartPhone == that.smartPhone && featuredPhone == that.featuredPhone && led == that.led && Objects.equals(catalogIds, that.catalogIds) && Objects.equals(excludeCatalogIds, that.excludeCatalogIds) && Objects.equals(brands, that.brands) && Objects.equals(itemIds, that.itemIds);
112
	}
131
	}
113
 
132
 
114
 
-
 
115
    @Override
133
	@Override
116
	public int hashCode() {
134
	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());
135
		return Objects.hash(id, startPrice, endPrice, catalogIds, excludeCatalogIds, smartPhone, featuredPhone, led, brands, itemIds);
123
		result = prime * result + (featuredPhone ? 1231 : 1237);
-
 
124
		result = prime * result + id;
-
 
125
		result = prime * result + ((itemIds == null) ? 0 : itemIds.hashCode());
-
 
126
		result = prime * result + (smartPhone ? 1231 : 1237);
-
 
127
		result = prime * result + Float.floatToIntBits(startPrice);
-
 
128
		return result;
-
 
129
	}
136
	}
130
 
137
 
-
 
138
	public boolean isLed() {
-
 
139
		return led;
-
 
140
	}
131
 
141
 
132
    @Override
-
 
133
	public boolean equals(Object obj) {
142
	public void setLed(boolean led) {
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;
-
 
158
		if (featuredPhone != other.featuredPhone)
-
 
159
			return false;
-
 
160
		if (id != other.id)
-
 
161
			return false;
-
 
162
		if (itemIds == null) {
-
 
163
			if (other.itemIds != null)
-
 
164
				return false;
143
		this.led = led;
165
		} else if (!itemIds.equals(other.itemIds))
-
 
166
			return false;
-
 
167
		if (smartPhone != other.smartPhone)
-
 
168
			return false;
-
 
169
		if (Float.floatToIntBits(startPrice) != Float.floatToIntBits(other.startPrice))
-
 
170
			return false;
-
 
171
		return true;
-
 
172
	}
144
	}
173
 
145
 
174
 
146
 
175
}
147
}