• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

box / box-java-sdk-gen / #290

24 Jun 2025 01:20PM UTC coverage: 35.757% (+0.1%) from 35.632%
#290

Pull #347

github

web-flow
Merge 2c100d09c into d8480ee6c
Pull Request #347: feat: Add Webhook Validation In Java (box/box-codegen#745)

68 of 82 new or added lines in 2 files covered. (82.93%)

11777 existing lines in 624 files now uncovered.

16984 of 47499 relevant lines covered (35.76%)

0.36 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

9.76
/src/main/java/com/box/sdkgen/schemas/trashfile/TrashFile.java
1
package com.box.sdkgen.schemas.trashfile;
2

3
import com.box.sdkgen.internal.Nullable;
4
import com.box.sdkgen.internal.NullableFieldTracker;
5
import com.box.sdkgen.internal.SerializableObject;
6
import com.box.sdkgen.internal.utils.DateTimeUtils;
7
import com.box.sdkgen.schemas.fileversionmini.FileVersionMini;
8
import com.box.sdkgen.schemas.foldermini.FolderMini;
9
import com.box.sdkgen.schemas.usermini.UserMini;
10
import com.box.sdkgen.serialization.json.EnumWrapper;
11
import com.fasterxml.jackson.annotation.JsonFilter;
12
import com.fasterxml.jackson.annotation.JsonProperty;
13
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
14
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
15
import java.util.Date;
16
import java.util.Objects;
17

18
@JsonFilter("nullablePropertyFilter")
19
public class TrashFile extends SerializableObject {
20

21
  protected final String id;
22

23
  @Nullable protected String etag;
24

25
  @JsonDeserialize(using = TrashFileTypeField.TrashFileTypeFieldDeserializer.class)
26
  @JsonSerialize(using = TrashFileTypeField.TrashFileTypeFieldSerializer.class)
27
  protected EnumWrapper<TrashFileTypeField> type;
28

29
  @JsonProperty("sequence_id")
30
  protected final String sequenceId;
31

32
  protected String name;
33

34
  protected final String sha1;
35

36
  @JsonProperty("file_version")
37
  protected FileVersionMini fileVersion;
38

39
  protected final String description;
40

41
  protected final long size;
42

43
  @JsonProperty("path_collection")
44
  protected final TrashFilePathCollectionField pathCollection;
45

46
  @JsonProperty("created_at")
47
  @JsonSerialize(using = DateTimeUtils.DateTimeSerializer.class)
48
  @JsonDeserialize(using = DateTimeUtils.DateTimeDeserializer.class)
49
  protected final Date createdAt;
50

51
  @JsonProperty("modified_at")
52
  @JsonSerialize(using = DateTimeUtils.DateTimeSerializer.class)
53
  @JsonDeserialize(using = DateTimeUtils.DateTimeDeserializer.class)
54
  protected final Date modifiedAt;
55

56
  @JsonProperty("trashed_at")
57
  @JsonSerialize(using = DateTimeUtils.DateTimeSerializer.class)
58
  @JsonDeserialize(using = DateTimeUtils.DateTimeDeserializer.class)
59
  @Nullable
60
  protected Date trashedAt;
61

62
  @JsonProperty("purged_at")
63
  @JsonSerialize(using = DateTimeUtils.DateTimeSerializer.class)
64
  @JsonDeserialize(using = DateTimeUtils.DateTimeDeserializer.class)
65
  @Nullable
66
  protected Date purgedAt;
67

68
  @JsonProperty("content_created_at")
69
  @JsonSerialize(using = DateTimeUtils.DateTimeSerializer.class)
70
  @JsonDeserialize(using = DateTimeUtils.DateTimeDeserializer.class)
71
  @Nullable
72
  protected Date contentCreatedAt;
73

74
  @JsonProperty("content_modified_at")
75
  @JsonSerialize(using = DateTimeUtils.DateTimeSerializer.class)
76
  @JsonDeserialize(using = DateTimeUtils.DateTimeDeserializer.class)
77
  @Nullable
78
  protected Date contentModifiedAt;
79

80
  @JsonProperty("created_by")
81
  protected UserMini createdBy;
82

83
  @JsonProperty("modified_by")
84
  protected final UserMini modifiedBy;
85

86
  @JsonProperty("owned_by")
87
  protected final UserMini ownedBy;
88

89
  @JsonProperty("shared_link")
90
  @Nullable
91
  protected String sharedLink;
92

93
  protected FolderMini parent;
94

95
  @JsonDeserialize(using = TrashFileItemStatusField.TrashFileItemStatusFieldDeserializer.class)
96
  @JsonSerialize(using = TrashFileItemStatusField.TrashFileItemStatusFieldSerializer.class)
97
  @JsonProperty("item_status")
98
  protected final EnumWrapper<TrashFileItemStatusField> itemStatus;
99

100
  public TrashFile(
101
      @JsonProperty("id") String id,
102
      @JsonProperty("sequence_id") String sequenceId,
103
      @JsonProperty("sha1") String sha1,
104
      @JsonProperty("description") String description,
105
      @JsonProperty("size") long size,
106
      @JsonProperty("path_collection") TrashFilePathCollectionField pathCollection,
107
      @JsonProperty("created_at") Date createdAt,
108
      @JsonProperty("modified_at") Date modifiedAt,
109
      @JsonProperty("modified_by") UserMini modifiedBy,
110
      @JsonProperty("owned_by") UserMini ownedBy,
111
      @JsonProperty("item_status") EnumWrapper<TrashFileItemStatusField> itemStatus) {
112
    super();
1✔
113
    this.id = id;
1✔
114
    this.sequenceId = sequenceId;
1✔
115
    this.sha1 = sha1;
1✔
116
    this.description = description;
1✔
117
    this.size = size;
1✔
118
    this.pathCollection = pathCollection;
1✔
119
    this.createdAt = createdAt;
1✔
120
    this.modifiedAt = modifiedAt;
1✔
121
    this.modifiedBy = modifiedBy;
1✔
122
    this.ownedBy = ownedBy;
1✔
123
    this.itemStatus = itemStatus;
1✔
124
    this.type = new EnumWrapper<TrashFileTypeField>(TrashFileTypeField.FILE);
1✔
125
  }
1✔
126

127
  public TrashFile(
128
      String id,
129
      String sequenceId,
130
      String sha1,
131
      String description,
132
      long size,
133
      TrashFilePathCollectionField pathCollection,
134
      Date createdAt,
135
      Date modifiedAt,
136
      UserMini modifiedBy,
137
      UserMini ownedBy,
138
      TrashFileItemStatusField itemStatus) {
139
    super();
×
140
    this.id = id;
×
141
    this.sequenceId = sequenceId;
×
142
    this.sha1 = sha1;
×
143
    this.description = description;
×
UNCOV
144
    this.size = size;
×
UNCOV
145
    this.pathCollection = pathCollection;
×
146
    this.createdAt = createdAt;
×
147
    this.modifiedAt = modifiedAt;
×
148
    this.modifiedBy = modifiedBy;
×
149
    this.ownedBy = ownedBy;
×
150
    this.itemStatus = new EnumWrapper<TrashFileItemStatusField>(itemStatus);
×
151
    this.type = new EnumWrapper<TrashFileTypeField>(TrashFileTypeField.FILE);
×
152
  }
×
153

154
  protected TrashFile(Builder builder) {
155
    super();
×
156
    this.id = builder.id;
×
157
    this.etag = builder.etag;
×
158
    this.type = builder.type;
×
159
    this.sequenceId = builder.sequenceId;
×
160
    this.name = builder.name;
×
161
    this.sha1 = builder.sha1;
×
162
    this.fileVersion = builder.fileVersion;
×
163
    this.description = builder.description;
×
164
    this.size = builder.size;
×
165
    this.pathCollection = builder.pathCollection;
×
166
    this.createdAt = builder.createdAt;
×
167
    this.modifiedAt = builder.modifiedAt;
×
168
    this.trashedAt = builder.trashedAt;
×
169
    this.purgedAt = builder.purgedAt;
×
UNCOV
170
    this.contentCreatedAt = builder.contentCreatedAt;
×
UNCOV
171
    this.contentModifiedAt = builder.contentModifiedAt;
×
UNCOV
172
    this.createdBy = builder.createdBy;
×
UNCOV
173
    this.modifiedBy = builder.modifiedBy;
×
UNCOV
174
    this.ownedBy = builder.ownedBy;
×
UNCOV
175
    this.sharedLink = builder.sharedLink;
×
176
    this.parent = builder.parent;
×
UNCOV
177
    this.itemStatus = builder.itemStatus;
×
UNCOV
178
    markNullableFieldsAsSet(builder.getExplicitlySetNullableFields());
×
UNCOV
179
  }
×
180

181
  public String getId() {
182
    return id;
1✔
183
  }
184

185
  public String getEtag() {
UNCOV
186
    return etag;
×
187
  }
188

189
  public EnumWrapper<TrashFileTypeField> getType() {
UNCOV
190
    return type;
×
191
  }
192

193
  public String getSequenceId() {
UNCOV
194
    return sequenceId;
×
195
  }
196

197
  public String getName() {
198
    return name;
1✔
199
  }
200

201
  public String getSha1() {
UNCOV
202
    return sha1;
×
203
  }
204

205
  public FileVersionMini getFileVersion() {
UNCOV
206
    return fileVersion;
×
207
  }
208

209
  public String getDescription() {
UNCOV
210
    return description;
×
211
  }
212

213
  public long getSize() {
UNCOV
214
    return size;
×
215
  }
216

217
  public TrashFilePathCollectionField getPathCollection() {
UNCOV
218
    return pathCollection;
×
219
  }
220

221
  public Date getCreatedAt() {
UNCOV
222
    return createdAt;
×
223
  }
224

225
  public Date getModifiedAt() {
UNCOV
226
    return modifiedAt;
×
227
  }
228

229
  public Date getTrashedAt() {
UNCOV
230
    return trashedAt;
×
231
  }
232

233
  public Date getPurgedAt() {
UNCOV
234
    return purgedAt;
×
235
  }
236

237
  public Date getContentCreatedAt() {
UNCOV
238
    return contentCreatedAt;
×
239
  }
240

241
  public Date getContentModifiedAt() {
UNCOV
242
    return contentModifiedAt;
×
243
  }
244

245
  public UserMini getCreatedBy() {
UNCOV
246
    return createdBy;
×
247
  }
248

249
  public UserMini getModifiedBy() {
UNCOV
250
    return modifiedBy;
×
251
  }
252

253
  public UserMini getOwnedBy() {
UNCOV
254
    return ownedBy;
×
255
  }
256

257
  public String getSharedLink() {
UNCOV
258
    return sharedLink;
×
259
  }
260

261
  public FolderMini getParent() {
262
    return parent;
×
263
  }
264

265
  public EnumWrapper<TrashFileItemStatusField> getItemStatus() {
UNCOV
266
    return itemStatus;
×
267
  }
268

269
  @Override
270
  public boolean equals(Object o) {
271
    if (this == o) {
×
272
      return true;
×
273
    }
274
    if (o == null || getClass() != o.getClass()) {
×
275
      return false;
×
276
    }
277
    TrashFile casted = (TrashFile) o;
×
278
    return Objects.equals(id, casted.id)
×
279
        && Objects.equals(etag, casted.etag)
×
280
        && Objects.equals(type, casted.type)
×
281
        && Objects.equals(sequenceId, casted.sequenceId)
×
282
        && Objects.equals(name, casted.name)
×
283
        && Objects.equals(sha1, casted.sha1)
×
284
        && Objects.equals(fileVersion, casted.fileVersion)
×
285
        && Objects.equals(description, casted.description)
×
286
        && Objects.equals(size, casted.size)
×
287
        && Objects.equals(pathCollection, casted.pathCollection)
×
288
        && Objects.equals(createdAt, casted.createdAt)
×
289
        && Objects.equals(modifiedAt, casted.modifiedAt)
×
UNCOV
290
        && Objects.equals(trashedAt, casted.trashedAt)
×
UNCOV
291
        && Objects.equals(purgedAt, casted.purgedAt)
×
UNCOV
292
        && Objects.equals(contentCreatedAt, casted.contentCreatedAt)
×
UNCOV
293
        && Objects.equals(contentModifiedAt, casted.contentModifiedAt)
×
294
        && Objects.equals(createdBy, casted.createdBy)
×
UNCOV
295
        && Objects.equals(modifiedBy, casted.modifiedBy)
×
UNCOV
296
        && Objects.equals(ownedBy, casted.ownedBy)
×
UNCOV
297
        && Objects.equals(sharedLink, casted.sharedLink)
×
UNCOV
298
        && Objects.equals(parent, casted.parent)
×
UNCOV
299
        && Objects.equals(itemStatus, casted.itemStatus);
×
300
  }
301

302
  @Override
303
  public int hashCode() {
UNCOV
304
    return Objects.hash(
×
305
        id,
306
        etag,
307
        type,
308
        sequenceId,
309
        name,
310
        sha1,
311
        fileVersion,
312
        description,
UNCOV
313
        size,
×
314
        pathCollection,
315
        createdAt,
316
        modifiedAt,
317
        trashedAt,
318
        purgedAt,
319
        contentCreatedAt,
320
        contentModifiedAt,
321
        createdBy,
322
        modifiedBy,
323
        ownedBy,
324
        sharedLink,
325
        parent,
326
        itemStatus);
327
  }
328

329
  @Override
330
  public String toString() {
UNCOV
331
    return "TrashFile{"
×
332
        + "id='"
333
        + id
334
        + '\''
335
        + ", "
336
        + "etag='"
337
        + etag
338
        + '\''
339
        + ", "
340
        + "type='"
341
        + type
342
        + '\''
343
        + ", "
344
        + "sequenceId='"
345
        + sequenceId
346
        + '\''
347
        + ", "
348
        + "name='"
349
        + name
350
        + '\''
351
        + ", "
352
        + "sha1='"
353
        + sha1
354
        + '\''
355
        + ", "
356
        + "fileVersion='"
357
        + fileVersion
358
        + '\''
359
        + ", "
360
        + "description='"
361
        + description
362
        + '\''
363
        + ", "
364
        + "size='"
365
        + size
366
        + '\''
367
        + ", "
368
        + "pathCollection='"
369
        + pathCollection
370
        + '\''
371
        + ", "
372
        + "createdAt='"
373
        + createdAt
374
        + '\''
375
        + ", "
376
        + "modifiedAt='"
377
        + modifiedAt
378
        + '\''
379
        + ", "
380
        + "trashedAt='"
381
        + trashedAt
382
        + '\''
383
        + ", "
384
        + "purgedAt='"
385
        + purgedAt
386
        + '\''
387
        + ", "
388
        + "contentCreatedAt='"
389
        + contentCreatedAt
390
        + '\''
391
        + ", "
392
        + "contentModifiedAt='"
393
        + contentModifiedAt
394
        + '\''
395
        + ", "
396
        + "createdBy='"
397
        + createdBy
398
        + '\''
399
        + ", "
400
        + "modifiedBy='"
401
        + modifiedBy
402
        + '\''
403
        + ", "
404
        + "ownedBy='"
405
        + ownedBy
406
        + '\''
407
        + ", "
408
        + "sharedLink='"
409
        + sharedLink
410
        + '\''
411
        + ", "
412
        + "parent='"
413
        + parent
414
        + '\''
415
        + ", "
416
        + "itemStatus='"
417
        + itemStatus
418
        + '\''
419
        + "}";
420
  }
421

422
  public static class Builder extends NullableFieldTracker {
423

424
    protected final String id;
425

426
    protected String etag;
427

428
    protected EnumWrapper<TrashFileTypeField> type;
429

430
    protected final String sequenceId;
431

432
    protected String name;
433

434
    protected final String sha1;
435

436
    protected FileVersionMini fileVersion;
437

438
    protected final String description;
439

440
    protected final long size;
441

442
    protected final TrashFilePathCollectionField pathCollection;
443

444
    protected final Date createdAt;
445

446
    protected final Date modifiedAt;
447

448
    protected Date trashedAt;
449

450
    protected Date purgedAt;
451

452
    protected Date contentCreatedAt;
453

454
    protected Date contentModifiedAt;
455

456
    protected UserMini createdBy;
457

458
    protected final UserMini modifiedBy;
459

460
    protected final UserMini ownedBy;
461

462
    protected String sharedLink;
463

464
    protected FolderMini parent;
465

466
    protected final EnumWrapper<TrashFileItemStatusField> itemStatus;
467

468
    public Builder(
469
        String id,
470
        String sequenceId,
471
        String sha1,
472
        String description,
473
        long size,
474
        TrashFilePathCollectionField pathCollection,
475
        Date createdAt,
476
        Date modifiedAt,
477
        UserMini modifiedBy,
478
        UserMini ownedBy,
479
        EnumWrapper<TrashFileItemStatusField> itemStatus) {
480
      super();
×
481
      this.id = id;
×
482
      this.sequenceId = sequenceId;
×
UNCOV
483
      this.sha1 = sha1;
×
UNCOV
484
      this.description = description;
×
UNCOV
485
      this.size = size;
×
UNCOV
486
      this.pathCollection = pathCollection;
×
UNCOV
487
      this.createdAt = createdAt;
×
UNCOV
488
      this.modifiedAt = modifiedAt;
×
UNCOV
489
      this.modifiedBy = modifiedBy;
×
UNCOV
490
      this.ownedBy = ownedBy;
×
UNCOV
491
      this.itemStatus = itemStatus;
×
UNCOV
492
      this.type = new EnumWrapper<TrashFileTypeField>(TrashFileTypeField.FILE);
×
UNCOV
493
    }
×
494

495
    public Builder(
496
        String id,
497
        String sequenceId,
498
        String sha1,
499
        String description,
500
        long size,
501
        TrashFilePathCollectionField pathCollection,
502
        Date createdAt,
503
        Date modifiedAt,
504
        UserMini modifiedBy,
505
        UserMini ownedBy,
506
        TrashFileItemStatusField itemStatus) {
507
      super();
×
508
      this.id = id;
×
UNCOV
509
      this.sequenceId = sequenceId;
×
UNCOV
510
      this.sha1 = sha1;
×
511
      this.description = description;
×
512
      this.size = size;
×
UNCOV
513
      this.pathCollection = pathCollection;
×
UNCOV
514
      this.createdAt = createdAt;
×
UNCOV
515
      this.modifiedAt = modifiedAt;
×
516
      this.modifiedBy = modifiedBy;
×
517
      this.ownedBy = ownedBy;
×
UNCOV
518
      this.itemStatus = new EnumWrapper<TrashFileItemStatusField>(itemStatus);
×
UNCOV
519
      this.type = new EnumWrapper<TrashFileTypeField>(TrashFileTypeField.FILE);
×
UNCOV
520
    }
×
521

522
    public Builder etag(String etag) {
UNCOV
523
      this.etag = etag;
×
UNCOV
524
      this.markNullableFieldAsSet("etag");
×
UNCOV
525
      return this;
×
526
    }
527

528
    public Builder type(TrashFileTypeField type) {
UNCOV
529
      this.type = new EnumWrapper<TrashFileTypeField>(type);
×
UNCOV
530
      return this;
×
531
    }
532

533
    public Builder type(EnumWrapper<TrashFileTypeField> type) {
UNCOV
534
      this.type = type;
×
UNCOV
535
      return this;
×
536
    }
537

538
    public Builder name(String name) {
UNCOV
539
      this.name = name;
×
UNCOV
540
      return this;
×
541
    }
542

543
    public Builder fileVersion(FileVersionMini fileVersion) {
UNCOV
544
      this.fileVersion = fileVersion;
×
UNCOV
545
      return this;
×
546
    }
547

548
    public Builder trashedAt(Date trashedAt) {
UNCOV
549
      this.trashedAt = trashedAt;
×
UNCOV
550
      this.markNullableFieldAsSet("trashed_at");
×
551
      return this;
×
552
    }
553

554
    public Builder purgedAt(Date purgedAt) {
UNCOV
555
      this.purgedAt = purgedAt;
×
556
      this.markNullableFieldAsSet("purged_at");
×
557
      return this;
×
558
    }
559

560
    public Builder contentCreatedAt(Date contentCreatedAt) {
561
      this.contentCreatedAt = contentCreatedAt;
×
562
      this.markNullableFieldAsSet("content_created_at");
×
UNCOV
563
      return this;
×
564
    }
565

566
    public Builder contentModifiedAt(Date contentModifiedAt) {
567
      this.contentModifiedAt = contentModifiedAt;
×
UNCOV
568
      this.markNullableFieldAsSet("content_modified_at");
×
UNCOV
569
      return this;
×
570
    }
571

572
    public Builder createdBy(UserMini createdBy) {
UNCOV
573
      this.createdBy = createdBy;
×
UNCOV
574
      return this;
×
575
    }
576

577
    public Builder sharedLink(String sharedLink) {
UNCOV
578
      this.sharedLink = sharedLink;
×
UNCOV
579
      this.markNullableFieldAsSet("shared_link");
×
UNCOV
580
      return this;
×
581
    }
582

583
    public Builder parent(FolderMini parent) {
UNCOV
584
      this.parent = parent;
×
UNCOV
585
      return this;
×
586
    }
587

588
    public TrashFile build() {
UNCOV
589
      return new TrashFile(this);
×
590
    }
591
  }
592
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc