Subversion Repositories SmartDukaan

Rev

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

Rev 25503 Rev 26679
Line 90... Line 90...
90
	private LocalDateTime expireTimestamp = null;
90
	private LocalDateTime expireTimestamp = null;
91
 
91
 
92
	@Column(name = "created_by")
92
	@Column(name = "created_by")
93
	private int createdBy;
93
	private int createdBy;
94
 
94
 
-
 
95
	@Column
-
 
96
	private boolean cashBack;
-
 
97
 
95
	@Transient
98
	@Transient
96
	private Set<Integer> retailerIds = new HashSet<>();
99
	private Set<Integer> retailerIds = new HashSet<>();
97
 
100
 
98
	@Column(name="partner_type")
101
	@Column(name="partner_type")
99
	@Enumerated(EnumType.STRING)
102
	@Enumerated(EnumType.STRING)
Line 124... Line 127...
124
 
127
 
125
	public void setDescription(String description) {
128
	public void setDescription(String description) {
126
		this.description = description;
129
		this.description = description;
127
	}
130
	}
128
 
131
 
-
 
132
	public boolean isCashBack() {
-
 
133
		return cashBack;
-
 
134
	}
-
 
135
 
-
 
136
	public void setCashBack(boolean cashBack) {
-
 
137
		this.cashBack = cashBack;
-
 
138
	}
-
 
139
 
129
	public SchemeType getType() {
140
	public SchemeType getType() {
130
		return type;
141
		return type;
131
	}
142
	}
132
 
143
 
133
	public void setType(SchemeType type) {
144
	public void setType(SchemeType type) {
Line 137... Line 148...
137
	@Override
148
	@Override
138
	public String toString() {
149
	public String toString() {
139
		return "Scheme [id=" + id + ", name=" + name + ", description=" + description + ", type=" + type
150
		return "Scheme [id=" + id + ", name=" + name + ", description=" + description + ", type=" + type
140
				+ ", amountType=" + amountType + ", amount=" + amount + ", startDateTime=" + startDateTime
151
				+ ", amountType=" + amountType + ", amount=" + amount + ", startDateTime=" + startDateTime
141
				+ ", endDateTime=" + endDateTime + ", createTimestamp=" + createTimestamp + ", activeTimestamp="
152
				+ ", endDateTime=" + endDateTime + ", createTimestamp=" + createTimestamp + ", activeTimestamp="
142
				+ activeTimestamp + ", expireTimestamp=" + expireTimestamp + ", createdBy=" + createdBy
153
				+ activeTimestamp + ", expireTimestamp=" + expireTimestamp + ", createdBy=" + createdBy + ", cashBack="
143
				+ ", retailerIds=" + retailerIds + ", partnerType=" + partnerType + ", itemStringMap=" + itemStringMap
154
				+ cashBack + ", retailerIds=" + retailerIds + ", partnerType=" + partnerType + ", itemStringMap="
144
				+ "]";
155
				+ itemStringMap + "]";
145
	}
156
	}
146
 
157
 
147
	public AmountType getAmountType() {
158
	public AmountType getAmountType() {
148
		return amountType;
159
		return amountType;
149
	}
160
	}
Line 283... Line 294...
283
 
294
 
284
	@Override
295
	@Override
285
	public int hashCode() {
296
	public int hashCode() {
286
		final int prime = 31;
297
		final int prime = 31;
287
		int result = 1;
298
		int result = 1;
-
 
299
		result = prime * result + ((activeTimestamp == null) ? 0 : activeTimestamp.hashCode());
-
 
300
		result = prime * result + Float.floatToIntBits(amount);
-
 
301
		result = prime * result + ((amountType == null) ? 0 : amountType.hashCode());
-
 
302
		result = prime * result + (cashBack ? 1231 : 1237);
-
 
303
		result = prime * result + ((createTimestamp == null) ? 0 : createTimestamp.hashCode());
-
 
304
		result = prime * result + createdBy;
-
 
305
		result = prime * result + ((description == null) ? 0 : description.hashCode());
-
 
306
		result = prime * result + ((endDateTime == null) ? 0 : endDateTime.hashCode());
-
 
307
		result = prime * result + ((expireTimestamp == null) ? 0 : expireTimestamp.hashCode());
288
		result = prime * result + id;
308
		result = prime * result + id;
-
 
309
		result = prime * result + ((itemStringMap == null) ? 0 : itemStringMap.hashCode());
-
 
310
		result = prime * result + ((name == null) ? 0 : name.hashCode());
-
 
311
		result = prime * result + ((partnerType == null) ? 0 : partnerType.hashCode());
-
 
312
		result = prime * result + ((retailerIds == null) ? 0 : retailerIds.hashCode());
-
 
313
		result = prime * result + ((startDateTime == null) ? 0 : startDateTime.hashCode());
-
 
314
		result = prime * result + ((type == null) ? 0 : type.hashCode());
289
		return result;
315
		return result;
290
	}
316
	}
291
 
317
 
292
	@Override
318
	@Override
293
	public boolean equals(Object obj) {
319
	public boolean equals(Object obj) {
Line 296... Line 322...
296
		if (obj == null)
322
		if (obj == null)
297
			return false;
323
			return false;
298
		if (getClass() != obj.getClass())
324
		if (getClass() != obj.getClass())
299
			return false;
325
			return false;
300
		Scheme other = (Scheme) obj;
326
		Scheme other = (Scheme) obj;
-
 
327
		if (activeTimestamp == null) {
-
 
328
			if (other.activeTimestamp != null)
-
 
329
				return false;
-
 
330
		} else if (!activeTimestamp.equals(other.activeTimestamp))
-
 
331
			return false;
-
 
332
		if (Float.floatToIntBits(amount) != Float.floatToIntBits(other.amount))
-
 
333
			return false;
-
 
334
		if (amountType != other.amountType)
-
 
335
			return false;
-
 
336
		if (cashBack != other.cashBack)
-
 
337
			return false;
-
 
338
		if (createTimestamp == null) {
-
 
339
			if (other.createTimestamp != null)
-
 
340
				return false;
-
 
341
		} else if (!createTimestamp.equals(other.createTimestamp))
-
 
342
			return false;
-
 
343
		if (createdBy != other.createdBy)
-
 
344
			return false;
-
 
345
		if (description == null) {
-
 
346
			if (other.description != null)
-
 
347
				return false;
-
 
348
		} else if (!description.equals(other.description))
-
 
349
			return false;
-
 
350
		if (endDateTime == null) {
-
 
351
			if (other.endDateTime != null)
-
 
352
				return false;
-
 
353
		} else if (!endDateTime.equals(other.endDateTime))
-
 
354
			return false;
-
 
355
		if (expireTimestamp == null) {
-
 
356
			if (other.expireTimestamp != null)
-
 
357
				return false;
-
 
358
		} else if (!expireTimestamp.equals(other.expireTimestamp))
-
 
359
			return false;
301
		if (id != other.id)
360
		if (id != other.id)
302
			return false;
361
			return false;
-
 
362
		if (itemStringMap == null) {
-
 
363
			if (other.itemStringMap != null)
-
 
364
				return false;
-
 
365
		} else if (!itemStringMap.equals(other.itemStringMap))
-
 
366
			return false;
-
 
367
		if (name == null) {
-
 
368
			if (other.name != null)
-
 
369
				return false;
-
 
370
		} else if (!name.equals(other.name))
-
 
371
			return false;
-
 
372
		if (partnerType != other.partnerType)
-
 
373
			return false;
-
 
374
		if (retailerIds == null) {
-
 
375
			if (other.retailerIds != null)
-
 
376
				return false;
-
 
377
		} else if (!retailerIds.equals(other.retailerIds))
-
 
378
			return false;
-
 
379
		if (startDateTime == null) {
-
 
380
			if (other.startDateTime != null)
-
 
381
				return false;
-
 
382
		} else if (!startDateTime.equals(other.startDateTime))
-
 
383
			return false;
-
 
384
		if (type != other.type)
-
 
385
			return false;
303
		return true;
386
		return true;
304
	}
387
	}
305
 
388
 
306
}
389
}
307
390