forked from Infosys/Discourse-Java
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathBadges.java
More file actions
414 lines (322 loc) · 9.42 KB
/
Copy pathBadges.java
File metadata and controls
414 lines (322 loc) · 9.42 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
/*
* Copyright 2021 Infosys Ltd.
* Use of this source code is governed by GNU General Public License version 2
* that can be found in the LICENSE file or at
* https://opensource.org/licenses/GPL-2.0
*/
package com.infy.domain;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import javax.persistence.*;
import javax.validation.constraints.*;
import java.io.Serializable;
/**
* A Badges.
*/
@Entity
@Table(name = "badges")
public class Badges extends AbstractAuditingEntity implements Serializable {
private static final long serialVersionUID = 1L;
@Id
@GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "sequenceGenerator")
@SequenceGenerator(name = "sequenceGenerator")
private Long id;
@NotNull
@Column(name = "name", nullable = false)
private String name;
@Column(name = "description")
private String description;
@NotNull
@Column(name = "badge_type_id", nullable = false)
private Long badgeTypeId;
@NotNull
@Column(name = "grant_count", nullable = false)
private Integer grantCount;
@NotNull
@Column(name = "allow_title", nullable = false)
private Boolean allowTitle;
@NotNull
@Column(name = "multiple_grant", nullable = false)
private Boolean multipleGrant;
@Column(name = "icon")
private String icon;
@Column(name = "listable")
private Boolean listable;
@Column(name = "target_posts")
private Boolean targetPosts;
@Column(name = "query")
private String query;
@NotNull
@Column(name = "enabled", nullable = false)
private Boolean enabled;
@NotNull
@Column(name = "auto_revoke", nullable = false)
private Boolean autoRevoke;
@NotNull
@Column(name = "badge_grouping_id", nullable = false)
private Long badgeGroupingId;
@Column(name = "trigger")
private Integer trigger;
@NotNull
@Column(name = "show_posts", nullable = false)
private Boolean showPosts;
@NotNull
@Column(name = "system", nullable = false)
private Boolean system;
@Column(name = "image")
private String image;
@Column(name = "long_description")
private String longDescription;
@Column(name = "image_upload_id")
private Long imageUploadId;
@ManyToOne
@JsonIgnoreProperties(value = "badges", allowSetters = true)
private UserProfiles userProfiles;
// jhipster-needle-entity-add-field - JHipster will add fields here
public Long getId() {
return id;
}
public void setId(Long id) {
this.id = id;
}
public String getName() {
return name;
}
public Badges name(String name) {
this.name = name;
return this;
}
public void setName(String name) {
this.name = name;
}
public String getDescription() {
return description;
}
public Badges description(String description) {
this.description = description;
return this;
}
public void setDescription(String description) {
this.description = description;
}
public Long getBadgeTypeId() {
return badgeTypeId;
}
public Badges badgeTypeId(Long badgeTypeId) {
this.badgeTypeId = badgeTypeId;
return this;
}
public void setBadgeTypeId(Long badgeTypeId) {
this.badgeTypeId = badgeTypeId;
}
public Integer getGrantCount() {
return grantCount;
}
public Badges grantCount(Integer grantCount) {
this.grantCount = grantCount;
return this;
}
public void setGrantCount(Integer grantCount) {
this.grantCount = grantCount;
}
public Boolean isAllowTitle() {
return allowTitle;
}
public Badges allowTitle(Boolean allowTitle) {
this.allowTitle = allowTitle;
return this;
}
public void setAllowTitle(Boolean allowTitle) {
this.allowTitle = allowTitle;
}
public Boolean isMultipleGrant() {
return multipleGrant;
}
public Badges multipleGrant(Boolean multipleGrant) {
this.multipleGrant = multipleGrant;
return this;
}
public void setMultipleGrant(Boolean multipleGrant) {
this.multipleGrant = multipleGrant;
}
public String getIcon() {
return icon;
}
public Badges icon(String icon) {
this.icon = icon;
return this;
}
public void setIcon(String icon) {
this.icon = icon;
}
public Boolean isListable() {
return listable;
}
public Badges listable(Boolean listable) {
this.listable = listable;
return this;
}
public void setListable(Boolean listable) {
this.listable = listable;
}
public Boolean isTargetPosts() {
return targetPosts;
}
public Badges targetPosts(Boolean targetPosts) {
this.targetPosts = targetPosts;
return this;
}
public void setTargetPosts(Boolean targetPosts) {
this.targetPosts = targetPosts;
}
public String getQuery() {
return query;
}
public Badges query(String query) {
this.query = query;
return this;
}
public void setQuery(String query) {
this.query = query;
}
public Boolean isEnabled() {
return enabled;
}
public Badges enabled(Boolean enabled) {
this.enabled = enabled;
return this;
}
public void setEnabled(Boolean enabled) {
this.enabled = enabled;
}
public Boolean isAutoRevoke() {
return autoRevoke;
}
public Badges autoRevoke(Boolean autoRevoke) {
this.autoRevoke = autoRevoke;
return this;
}
public void setAutoRevoke(Boolean autoRevoke) {
this.autoRevoke = autoRevoke;
}
public Long getBadgeGroupingId() {
return badgeGroupingId;
}
public Badges badgeGroupingId(Long badgeGroupingId) {
this.badgeGroupingId = badgeGroupingId;
return this;
}
public void setBadgeGroupingId(Long badgeGroupingId) {
this.badgeGroupingId = badgeGroupingId;
}
public Integer getTrigger() {
return trigger;
}
public Badges trigger(Integer trigger) {
this.trigger = trigger;
return this;
}
public void setTrigger(Integer trigger) {
this.trigger = trigger;
}
public Boolean isShowPosts() {
return showPosts;
}
public Badges showPosts(Boolean showPosts) {
this.showPosts = showPosts;
return this;
}
public void setShowPosts(Boolean showPosts) {
this.showPosts = showPosts;
}
public Boolean isSystem() {
return system;
}
public Badges system(Boolean system) {
this.system = system;
return this;
}
public void setSystem(Boolean system) {
this.system = system;
}
public String getImage() {
return image;
}
public Badges image(String image) {
this.image = image;
return this;
}
public void setImage(String image) {
this.image = image;
}
public String getLongDescription() {
return longDescription;
}
public Badges longDescription(String longDescription) {
this.longDescription = longDescription;
return this;
}
public void setLongDescription(String longDescription) {
this.longDescription = longDescription;
}
public Long getImageUploadId() {
return imageUploadId;
}
public Badges imageUploadId(Long imageUploadId) {
this.imageUploadId = imageUploadId;
return this;
}
public void setImageUploadId(Long imageUploadId) {
this.imageUploadId = imageUploadId;
}
public UserProfiles getUserProfiles() {
return userProfiles;
}
public Badges userProfiles(UserProfiles userProfiles) {
this.userProfiles = userProfiles;
return this;
}
public void setUserProfiles(UserProfiles userProfiles) {
this.userProfiles = userProfiles;
}
// jhipster-needle-entity-add-getters-setters - JHipster will add getters and setters here
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (!(o instanceof Badges)) {
return false;
}
return id != null && id.equals(((Badges) o).id);
}
@Override
public int hashCode() {
return 31;
}
// prettier-ignore
@Override
public String toString() {
return "Badges{" +
"id=" + getId() +
", name='" + getName() + "'" +
", description='" + getDescription() + "'" +
", badgeTypeId=" + getBadgeTypeId() +
", grantCount=" + getGrantCount() +
", allowTitle='" + isAllowTitle() + "'" +
", multipleGrant='" + isMultipleGrant() + "'" +
", icon='" + getIcon() + "'" +
", listable='" + isListable() + "'" +
", targetPosts='" + isTargetPosts() + "'" +
", query='" + getQuery() + "'" +
", enabled='" + isEnabled() + "'" +
", autoRevoke='" + isAutoRevoke() + "'" +
", badgeGroupingId=" + getBadgeGroupingId() +
", trigger=" + getTrigger() +
", showPosts='" + isShowPosts() + "'" +
", system='" + isSystem() + "'" +
", image='" + getImage() + "'" +
", longDescription='" + getLongDescription() + "'" +
", imageUploadId=" + getImageUploadId() +
"}";
}
}