Subversion Repositories SmartDukaan

Rev

Rev 36528 | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
25649 tejbeer 1
package com.spice.profitmandi.common.model;
2
 
29942 amit.gupta 3
import com.spice.profitmandi.common.enumuration.MessageType;
37508 ranu 4
import com.spice.profitmandi.common.enumuration.NotificationCategory;
5
import com.spice.profitmandi.common.enumuration.NotificationFormat;
29942 amit.gupta 6
 
25651 tejbeer 7
import java.time.LocalDateTime;
8
import java.time.ZoneOffset;
37508 ranu 9
import java.util.List;
29942 amit.gupta 10
import java.util.Objects;
25651 tejbeer 11
 
25649 tejbeer 12
public class Notification {
13
	private String cid;
14
	private String title;
15
	private String type;
16
	private String message;
17
	private String imageUrl;
18
	private String url;
19
	private Boolean showImage;
29942 amit.gupta 20
	private String htmlUrl;
25649 tejbeer 21
	private long created;
25683 tejbeer 22
 
25651 tejbeer 23
	public LocalDateTime getDate() {
25683 tejbeer 24
		return LocalDateTime.ofEpochSecond(created / 1000, 0, ZoneOffset.ofHoursMinutes(5, 30));
25651 tejbeer 25
	}
25683 tejbeer 26
 
25649 tejbeer 27
	private boolean expired;
36528 vikas 28
	private boolean read;
25683 tejbeer 29
 
30
	private MessageType messageType;
31
 
37508 ranu 32
	private NotificationFormat format;
33
	private NotificationCategory category;
34
 
35
	// Pop-up config (only meaningful when format = IN_APP_POPUP)
36
	private String buttonLabel;
37
	private Boolean showCta;
38
	private Boolean showClose;
39
	private String showOnPage;
40
	private Integer autoCloseSeconds;
41
	private LocalDateTime liveFrom;
42
	private LocalDateTime liveUntil;
43
 
25651 tejbeer 44
	private Integer documentId;
45
	private String documentName;
25649 tejbeer 46
 
37508 ranu 47
	/**
48
	 * Products / schemes / offers attached to this notification. Tap = deep-link into that entity.
49
	 */
50
	private List<LinkedEntity> linkedEntities;
51
 
52
	// Story-specific (only meaningful when format = STORY)
53
	private List<String> storyCards;
54
	private String postInCategory;
55
	private Integer playDurationSeconds;
56
 
57
	public List<LinkedEntity> getLinkedEntities() {
58
		return linkedEntities;
59
	}
60
 
61
	public void setLinkedEntities(List<LinkedEntity> linkedEntities) {
62
		this.linkedEntities = linkedEntities;
63
	}
64
 
65
	public List<String> getStoryCards() {
66
		return storyCards;
67
	}
68
 
69
	public void setStoryCards(List<String> storyCards) {
70
		this.storyCards = storyCards;
71
	}
72
 
73
	public String getPostInCategory() {
74
		return postInCategory;
75
	}
76
 
77
	public void setPostInCategory(String postInCategory) {
78
		this.postInCategory = postInCategory;
79
	}
80
 
81
	public Integer getPlayDurationSeconds() {
82
		return playDurationSeconds;
83
	}
84
 
85
	public void setPlayDurationSeconds(Integer playDurationSeconds) {
86
		this.playDurationSeconds = playDurationSeconds;
87
	}
88
 
89
	public String getButtonLabel() {
90
		return buttonLabel;
91
	}
92
 
93
	public void setButtonLabel(String buttonLabel) {
94
		this.buttonLabel = buttonLabel;
95
	}
96
 
97
	public Boolean getShowCta() {
98
		return showCta;
99
	}
100
 
101
	public void setShowCta(Boolean showCta) {
102
		this.showCta = showCta;
103
	}
104
 
105
	public Boolean getShowClose() {
106
		return showClose;
107
	}
108
 
109
	public void setShowClose(Boolean showClose) {
110
		this.showClose = showClose;
111
	}
112
 
113
	public String getShowOnPage() {
114
		return showOnPage;
115
	}
116
 
117
	public void setShowOnPage(String showOnPage) {
118
		this.showOnPage = showOnPage;
119
	}
120
 
121
	public Integer getAutoCloseSeconds() {
122
		return autoCloseSeconds;
123
	}
124
 
125
	public void setAutoCloseSeconds(Integer autoCloseSeconds) {
126
		this.autoCloseSeconds = autoCloseSeconds;
127
	}
128
 
129
	public LocalDateTime getLiveFrom() {
130
		return liveFrom;
131
	}
132
 
133
	public void setLiveFrom(LocalDateTime liveFrom) {
134
		this.liveFrom = liveFrom;
135
	}
136
 
137
	public LocalDateTime getLiveUntil() {
138
		return liveUntil;
139
	}
140
 
141
	public void setLiveUntil(LocalDateTime liveUntil) {
142
		this.liveUntil = liveUntil;
143
	}
144
 
145
	public NotificationFormat getFormat() {
146
		return format;
147
	}
148
 
149
	public void setFormat(NotificationFormat format) {
150
		this.format = format;
151
	}
152
 
153
	public NotificationCategory getCategory() {
154
		return category;
155
	}
156
 
157
	public void setCategory(NotificationCategory category) {
158
		this.category = category;
159
	}
160
 
25683 tejbeer 161
	public MessageType getMessageType() {
162
		return messageType;
163
	}
164
 
165
	public void setMessageType(MessageType messageType) {
166
		this.messageType = messageType;
167
	}
168
 
25651 tejbeer 169
	public String getDocumentName() {
170
		return documentName;
171
	}
172
 
173
	public void setDocumentName(String documentName) {
174
		this.documentName = documentName;
175
	}
176
 
177
	public Integer getDocumentId() {
178
		return documentId;
179
	}
180
 
181
	public void setDocumentId(Integer documentId) {
182
		this.documentId = documentId;
183
	}
184
 
25649 tejbeer 185
	public String getCid() {
186
		return cid;
187
	}
188
 
189
	public void setCid(String cid) {
190
		this.cid = cid;
191
	}
192
 
193
	public String getTitle() {
194
		return title;
195
	}
196
 
29942 amit.gupta 197
	@Override
198
	public boolean equals(Object o) {
199
		if (this == o) return true;
200
		if (o == null || getClass() != o.getClass()) return false;
201
		Notification that = (Notification) o;
37508 ranu 202
		return created == that.created && expired == that.expired && Objects.equals(cid, that.cid) && Objects.equals(title, that.title) && Objects.equals(type, that.type) && Objects.equals(message, that.message) && Objects.equals(imageUrl, that.imageUrl) && Objects.equals(url, that.url) && Objects.equals(showImage, that.showImage) && Objects.equals(htmlUrl, that.htmlUrl) && messageType == that.messageType && format == that.format && category == that.category && Objects.equals(documentId, that.documentId) && Objects.equals(documentName, that.documentName);
29942 amit.gupta 203
	}
204
 
205
	@Override
206
	public int hashCode() {
37508 ranu 207
		return Objects.hash(cid, title, type, message, imageUrl, url, showImage, htmlUrl, created, expired, messageType, format, category, documentId, documentName);
29942 amit.gupta 208
	}
209
 
210
	public String getHtmlUrl() {
211
		return htmlUrl;
212
	}
213
 
214
	public void setHtmlUrl(String htmlUrl) {
215
		this.htmlUrl = htmlUrl;
216
	}
217
 
25649 tejbeer 218
	public void setTitle(String title) {
219
		this.title = title;
220
	}
221
 
222
	public String getType() {
223
		return type;
224
	}
225
 
226
	public void setType(String type) {
227
		this.type = type;
228
	}
229
 
230
	public String getMessage() {
231
		return message;
232
	}
233
 
234
	public void setMessage(String message) {
235
		this.message = message;
236
	}
237
 
238
	public String getUrl() {
239
		return url;
240
	}
241
 
242
	public void setUrl(String url) {
243
		this.url = url;
244
	}
245
 
246
	public boolean isExpired() {
247
		return expired;
248
	}
249
 
250
	public String getImageUrl() {
251
		return imageUrl;
252
	}
253
 
254
	public void setImageUrl(String imageUrl) {
255
		this.imageUrl = imageUrl;
256
	}
257
 
258
	public Boolean getShowImage() {
259
		return showImage;
260
	}
261
 
262
	public void setExpired(boolean expired) {
263
		this.expired = expired;
264
	}
265
 
36528 vikas 266
	public boolean isRead() {
267
		return read;
268
	}
269
 
270
	public void setRead(boolean read) {
271
		this.read = read;
272
	}
273
 
25649 tejbeer 274
	public long getCreated() {
275
		return created;
276
	}
277
 
278
	public void setCreated(long created) {
279
		this.created = created;
280
	}
281
 
282
	public Boolean isShowImage() {
283
		return showImage;
284
	}
285
 
286
	public void setShowImage(Boolean showImage) {
287
		this.showImage = showImage;
288
	}
289
 
290
}