forked from fabienrenaud/java-json-benchmark
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Users.java
395 lines (319 loc) · 9.96 KB
/
Users.java
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
package com.github.fabienrenaud.jjb.model;
import com.bluelinelabs.logansquare.annotation.JsonField;
import com.bluelinelabs.logansquare.annotation.JsonObject;
import com.dslplatform.json.CompiledJson;
import com.dslplatform.json.JsonAttribute;
import io.github.wycst.wast.json.annotations.JsonTypeSetting;
import java.util.List;
import java.util.Objects;
@io.avaje.jsonb.Json
@JsonObject
@CompiledJson
@jodd.json.meta.JSON
@JsonTypeSetting(enableJIT = true)
public class Users {
@JsonField
@jodd.json.meta.JSON
private List<User> users;
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (!(o instanceof Users)) {
return false;
}
Users that = (Users) o;
return Objects.equals(users, that.users);
}
@Override
public int hashCode() {
return Objects.hashCode(users);
}
@Override
public String toString() {
return "Users{" + "users=" + users + '}';
}
public List<User> getUsers() {
return users;
}
public void setUsers(List<User> users) {
this.users = users;
}
@io.avaje.jsonb.Json
@JsonObject
@CompiledJson
@JsonTypeSetting(enableJIT = true)
public static final class User {
@JsonField
private String id;
@JsonField
private int index;
@JsonField
private String guid;
@JsonField
private boolean isActive;
@JsonField
private String balance;
@JsonField
private String picture;
@JsonField
private int age;
@JsonField
private String eyeColor;
@JsonField
private String name;
@JsonField
private String gender;
@JsonField
private String company;
@JsonField
private String email;
@JsonField
private String phone;
@JsonField
private String address;
@JsonField
private String about;
@JsonField
private String registered;
@JsonField
private double latitude;
@JsonField
private double longitude;
@JsonField
@JsonAttribute(nullable = false)
@jodd.json.meta.JSON
private List<String> tags;
@JsonField
@JsonAttribute(nullable = false)
@jodd.json.meta.JSON
private List<Friend> friends;
@JsonField
private String greeting;
@JsonField
private String favoriteFruit;
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (!(o instanceof User)) {
return false;
}
User user = (User) o;
return index == user.index &&
isActive == user.isActive &&
age == user.age &&
Math.abs(Double.doubleToLongBits(user.latitude) - Double.doubleToLongBits(latitude)) < 3 &&
Math.abs(Double.doubleToLongBits(user.longitude) - Double.doubleToLongBits(longitude)) < 3 &&
Objects.equals(id, user.id) &&
Objects.equals(guid, user.guid) &&
Objects.equals(balance, user.balance) &&
Objects.equals(picture, user.picture) &&
Objects.equals(eyeColor, user.eyeColor) &&
Objects.equals(name, user.name) &&
Objects.equals(gender, user.gender) &&
Objects.equals(company, user.company) &&
Objects.equals(email, user.email) &&
Objects.equals(phone, user.phone) &&
Objects.equals(address, user.address) &&
Objects.equals(about, user.about) &&
Objects.equals(registered, user.registered) &&
Objects.equals(tags, user.tags) &&
Objects.equals(friends, user.friends) &&
Objects.equals(greeting, user.greeting) &&
Objects.equals(favoriteFruit, user.favoriteFruit);
}
@Override
public int hashCode() {
return Objects.hash(id, index, guid, isActive, balance, picture, age, eyeColor, name, gender, company, email, phone, address, about, registered, tags, friends, greeting, favoriteFruit);
}
@Override
public String toString() {
return "JsonDataObj{" + "id=" + id + ", index=" + index + ", guid=" + guid + ", isActive=" + isActive + ", balance=" + balance + ", picture=" + picture + ", age=" + age + ", eyeColor=" + eyeColor + ", name=" + name + ", gender=" + gender + ", company=" + company + ", email=" + email + ", phone=" + phone + ", address=" + address + ", about=" + about + ", registered=" + registered + ", latitude=" + latitude + ", longitude=" + longitude + ", tags=" + tags + ", friends=" + friends + ", greeting=" + greeting + ", favoriteFruit=" + favoriteFruit + '}';
}
public String getId() {
return id;
}
public void setId(String id) {
this.id = id;
}
public int getIndex() {
return index;
}
public void setIndex(int index) {
this.index = index;
}
public String getGuid() {
return guid;
}
public void setGuid(String guid) {
this.guid = guid;
}
public boolean getIsActive() {
return isActive;
}
public void setIsActive(boolean isActive) {
this.isActive = isActive;
}
public String getBalance() {
return balance;
}
public void setBalance(String balance) {
this.balance = balance;
}
public String getPicture() {
return picture;
}
public void setPicture(String picture) {
this.picture = picture;
}
public int getAge() {
return age;
}
public void setAge(int age) {
this.age = age;
}
public String getEyeColor() {
return eyeColor;
}
public void setEyeColor(String eyeColor) {
this.eyeColor = eyeColor;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getGender() {
return gender;
}
public void setGender(String gender) {
this.gender = gender;
}
public String getCompany() {
return company;
}
public void setCompany(String company) {
this.company = company;
}
public String getEmail() {
return email;
}
public void setEmail(String email) {
this.email = email;
}
public String getPhone() {
return phone;
}
public void setPhone(String phone) {
this.phone = phone;
}
public String getAddress() {
return address;
}
public void setAddress(String address) {
this.address = address;
}
public String getAbout() {
return about;
}
public void setAbout(String about) {
this.about = about;
}
public String getRegistered() {
return registered;
}
public void setRegistered(String registered) {
this.registered = registered;
}
public double getLatitude() {
return latitude;
}
public void setLatitude(double latitude) {
this.latitude = latitude;
}
public double getLongitude() {
return longitude;
}
public void setLongitude(double longitude) {
this.longitude = longitude;
}
public List<String> getTags() {
return tags;
}
public void setTags(List<String> tags) {
this.tags = tags;
}
public List<Friend> getFriends() {
return friends;
}
public void setFriends(List<Friend> friends) {
this.friends = friends;
}
public String getGreeting() {
return greeting;
}
public void setGreeting(String greeting) {
this.greeting = greeting;
}
public String getFavoriteFruit() {
return favoriteFruit;
}
public void setFavoriteFruit(String favoriteFruit) {
this.favoriteFruit = favoriteFruit;
}
}
@io.avaje.jsonb.Json
@JsonObject
@CompiledJson
@JsonTypeSetting(enableJIT = true)
public static final class Friend {
@JsonField
private String id;
@JsonField
private String name;
public Friend() {
}
public static Friend create(String id, String name) {
Friend friend = new Friend();
friend.id = id;
friend.name = name;
return friend;
}
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (!(o instanceof Friend)) {
return false;
}
Friend friend = (Friend) o;
return Objects.equals(id, friend.id) &&
Objects.equals(name, friend.name);
}
@Override
public int hashCode() {
return Objects.hash(id, name);
}
@Override
public String toString() {
return "Friend{" + "id=" + id + ", name=" + name + '}';
}
public String getId() {
return id;
}
public void setId(String id) {
this.id = id;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
}
}