-
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathClaimedKit.java
More file actions
162 lines (129 loc) · 3.98 KB
/
Copy pathClaimedKit.java
File metadata and controls
162 lines (129 loc) · 3.98 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
package net.onelitefeather.playerkits.kit;
import jakarta.persistence.*;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import java.util.Objects;
import java.util.UUID;
@Entity
@Table(name = "claimed_kits")
public class ClaimedKit {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
private Long id;
@Column(columnDefinition = "VARCHAR(36)")
private String claimedBy;
@Column
private Long kitId;
@Column
private Boolean firstJoin;
@Column
private Boolean oneTime;
@Column
private Long claimedAt;
@Column
private Long cooldown;
public ClaimedKit() {
}
public ClaimedKit(@Nullable Long id,
@NotNull String claimedBy,
@NotNull Long kitId,
@NotNull Boolean firstJoin,
@NotNull Boolean oneTime,
@NotNull Long claimedAt,
@NotNull Long cooldown) {
this.id = id;
this.claimedBy = claimedBy;
this.kitId = kitId;
this.firstJoin = firstJoin;
this.oneTime = oneTime;
this.claimedAt = claimedAt;
this.cooldown = cooldown;
}
@NotNull
public Long getId() {
return id;
}
public void setId(@NotNull Long id) {
this.id = id;
}
@NotNull
public UUID getClaimedUniqueId() {
return UUID.fromString(this.claimedBy);
}
public void setClaimedByUniqueId(@NotNull UUID claimedUniqueId) {
this.claimedBy = claimedUniqueId.toString();
}
@NotNull
public String getClaimedBy() {
return claimedBy;
}
public void setClaimedBy(@NotNull String claimedBy) {
this.claimedBy = claimedBy;
}
@NotNull
public Long getKitId() {
return kitId;
}
public void setKitId(@NotNull Long kitId) {
this.kitId = kitId;
}
@NotNull
public Boolean getFirstJoin() {
return firstJoin;
}
public void setFirstJoin(@NotNull Boolean firstJoin) {
this.firstJoin = firstJoin;
}
@NotNull
public Boolean getOneTime() {
return oneTime;
}
public void setOneTime(@NotNull Boolean oneTime) {
this.oneTime = oneTime;
}
@NotNull
public Long getClaimedAt() {
return claimedAt;
}
public void setClaimedAt(@NotNull Long claimedAt) {
this.claimedAt = claimedAt;
}
@NotNull
public Long getCooldown() {
return cooldown;
}
public void setCooldown(@NotNull Long cooldown) {
this.cooldown = cooldown;
}
@Override
public String toString() {
return "ClaimedKit{" +
"id=" + id +
", claimedBy='" + claimedBy + '\'' +
", kitName='" + kitId + '\'' +
'}';
}
@Override
public boolean equals(Object o) {
if (this == o) return true;
if (!(o instanceof ClaimedKit that)) return false;
if (!Objects.equals(id, that.id)) return false;
if (!Objects.equals(claimedBy, that.claimedBy)) return false;
if (!Objects.equals(kitId, that.kitId)) return false;
if (!Objects.equals(firstJoin, that.firstJoin)) return false;
if (!Objects.equals(oneTime, that.oneTime)) return false;
if (!Objects.equals(claimedAt, that.claimedAt)) return false;
return Objects.equals(cooldown, that.cooldown);
}
@Override
public int hashCode() {
int result = id != null ? id.hashCode() : 0;
result = 31 * result + (claimedBy != null ? claimedBy.hashCode() : 0);
result = 31 * result + (kitId != null ? kitId.hashCode() : 0);
result = 31 * result + (firstJoin != null ? firstJoin.hashCode() : 0);
result = 31 * result + (oneTime != null ? oneTime.hashCode() : 0);
result = 31 * result + (claimedAt != null ? claimedAt.hashCode() : 0);
result = 31 * result + (cooldown != null ? cooldown.hashCode() : 0);
return result;
}
}