forked from Infosys/Discourse-Java
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathApiKeys.java
More file actions
203 lines (159 loc) · 4.57 KB
/
Copy pathApiKeys.java
File metadata and controls
203 lines (159 loc) · 4.57 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
/*
* 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 javax.persistence.*;
import javax.validation.constraints.*;
import java.io.Serializable;
import java.time.Instant;
/**
* A ApiKeys.
*/
@Entity
@Table(name = "api_keys")
public class ApiKeys extends AbstractAuditingEntity implements Serializable {
private static final long serialVersionUID = 1L;
@Id
@GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "sequenceGenerator")
@SequenceGenerator(name = "sequenceGenerator")
private Long id;
@Column(name = "user_id")
private String userId;
@Column(name = "allowed_ips")
private String allowedIps;
@NotNull
@Column(name = "hidden", nullable = false)
private Boolean hidden;
@Column(name = "last_used_at")
private Instant lastUsedAt;
@Column(name = "revoked_at")
private Instant revokedAt;
@Column(name = "description")
private String description;
@NotNull
@Column(name = "key_hash", nullable = false)
private String keyHash;
@NotNull
@Column(name = "truncated_key", nullable = false)
private String truncatedKey;
// 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 getUserId() {
return userId;
}
public ApiKeys userId(String userId) {
this.userId = userId;
return this;
}
public void setUserId(String userId) {
this.userId = userId;
}
public String getAllowedIps() {
return allowedIps;
}
public ApiKeys allowedIps(String allowedIps) {
this.allowedIps = allowedIps;
return this;
}
public void setAllowedIps(String allowedIps) {
this.allowedIps = allowedIps;
}
public Boolean isHidden() {
return hidden;
}
public ApiKeys hidden(Boolean hidden) {
this.hidden = hidden;
return this;
}
public void setHidden(Boolean hidden) {
this.hidden = hidden;
}
public Instant getLastUsedAt() {
return lastUsedAt;
}
public ApiKeys lastUsedAt(Instant lastUsedAt) {
this.lastUsedAt = lastUsedAt;
return this;
}
public void setLastUsedAt(Instant lastUsedAt) {
this.lastUsedAt = lastUsedAt;
}
public Instant getRevokedAt() {
return revokedAt;
}
public ApiKeys revokedAt(Instant revokedAt) {
this.revokedAt = revokedAt;
return this;
}
public void setRevokedAt(Instant revokedAt) {
this.revokedAt = revokedAt;
}
public String getDescription() {
return description;
}
public ApiKeys description(String description) {
this.description = description;
return this;
}
public void setDescription(String description) {
this.description = description;
}
public String getKeyHash() {
return keyHash;
}
public ApiKeys keyHash(String keyHash) {
this.keyHash = keyHash;
return this;
}
public void setKeyHash(String keyHash) {
this.keyHash = keyHash;
}
public String getTruncatedKey() {
return truncatedKey;
}
public ApiKeys truncatedKey(String truncatedKey) {
this.truncatedKey = truncatedKey;
return this;
}
public void setTruncatedKey(String truncatedKey) {
this.truncatedKey = truncatedKey;
}
// 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 ApiKeys)) {
return false;
}
return id != null && id.equals(((ApiKeys) o).id);
}
@Override
public int hashCode() {
return 31;
}
// prettier-ignore
@Override
public String toString() {
return "ApiKeys{" +
"id=" + getId() +
", userId='" + getUserId() + "'" +
", allowedIps='" + getAllowedIps() + "'" +
", hidden='" + isHidden() + "'" +
", lastUsedAt='" + getLastUsedAt() + "'" +
", revokedAt='" + getRevokedAt() + "'" +
", description='" + getDescription() + "'" +
", keyHash='" + getKeyHash() + "'" +
", truncatedKey='" + getTruncatedKey() + "'" +
"}";
}
}