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

box / box-java-sdk-gen / #360

14 Jul 2025 11:20AM UTC coverage: 38.091% (+2.5%) from 35.58%
#360

push

github

web-flow
feat: Support common union fields and implicit union conversion (box/box-codegen#758) (#361)

288 of 1203 new or added lines in 106 files covered. (23.94%)

167 existing lines in 45 files now uncovered.

18543 of 48681 relevant lines covered (38.09%)

0.38 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
      String id,
102
      String sequenceId,
103
      String sha1,
104
      String description,
105
      long size,
106
      TrashFilePathCollectionField pathCollection,
107
      Date createdAt,
108
      Date modifiedAt,
109
      UserMini modifiedBy,
110
      UserMini ownedBy,
111
      TrashFileItemStatusField itemStatus) {
UNCOV
112
    super();
×
UNCOV
113
    this.id = id;
×
UNCOV
114
    this.sequenceId = sequenceId;
×
UNCOV
115
    this.sha1 = sha1;
×
UNCOV
116
    this.description = description;
×
UNCOV
117
    this.size = size;
×
UNCOV
118
    this.pathCollection = pathCollection;
×
UNCOV
119
    this.createdAt = createdAt;
×
UNCOV
120
    this.modifiedAt = modifiedAt;
×
UNCOV
121
    this.modifiedBy = modifiedBy;
×
UNCOV
122
    this.ownedBy = ownedBy;
×
NEW
123
    this.itemStatus = new EnumWrapper<TrashFileItemStatusField>(itemStatus);
×
UNCOV
124
    this.type = new EnumWrapper<TrashFileTypeField>(TrashFileTypeField.FILE);
×
UNCOV
125
  }
×
126

127
  public TrashFile(
128
      @JsonProperty("id") String id,
129
      @JsonProperty("sequence_id") String sequenceId,
130
      @JsonProperty("sha1") String sha1,
131
      @JsonProperty("description") String description,
132
      @JsonProperty("size") long size,
133
      @JsonProperty("path_collection") TrashFilePathCollectionField pathCollection,
134
      @JsonProperty("created_at") Date createdAt,
135
      @JsonProperty("modified_at") Date modifiedAt,
136
      @JsonProperty("modified_by") UserMini modifiedBy,
137
      @JsonProperty("owned_by") UserMini ownedBy,
138
      @JsonProperty("item_status") EnumWrapper<TrashFileItemStatusField> itemStatus) {
139
    super();
1✔
140
    this.id = id;
1✔
141
    this.sequenceId = sequenceId;
1✔
142
    this.sha1 = sha1;
1✔
143
    this.description = description;
1✔
144
    this.size = size;
1✔
145
    this.pathCollection = pathCollection;
1✔
146
    this.createdAt = createdAt;
1✔
147
    this.modifiedAt = modifiedAt;
1✔
148
    this.modifiedBy = modifiedBy;
1✔
149
    this.ownedBy = ownedBy;
1✔
150
    this.itemStatus = itemStatus;
1✔
151
    this.type = new EnumWrapper<TrashFileTypeField>(TrashFileTypeField.FILE);
1✔
152
  }
1✔
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;
×
170
    this.contentCreatedAt = builder.contentCreatedAt;
×
171
    this.contentModifiedAt = builder.contentModifiedAt;
×
172
    this.createdBy = builder.createdBy;
×
173
    this.modifiedBy = builder.modifiedBy;
×
174
    this.ownedBy = builder.ownedBy;
×
175
    this.sharedLink = builder.sharedLink;
×
176
    this.parent = builder.parent;
×
177
    this.itemStatus = builder.itemStatus;
×
178
    markNullableFieldsAsSet(builder.getExplicitlySetNullableFields());
×
179
  }
×
180

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

265
  public EnumWrapper<TrashFileItemStatusField> getItemStatus() {
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)
×
290
        && Objects.equals(trashedAt, casted.trashedAt)
×
291
        && Objects.equals(purgedAt, casted.purgedAt)
×
292
        && Objects.equals(contentCreatedAt, casted.contentCreatedAt)
×
293
        && Objects.equals(contentModifiedAt, casted.contentModifiedAt)
×
294
        && Objects.equals(createdBy, casted.createdBy)
×
295
        && Objects.equals(modifiedBy, casted.modifiedBy)
×
296
        && Objects.equals(ownedBy, casted.ownedBy)
×
297
        && Objects.equals(sharedLink, casted.sharedLink)
×
298
        && Objects.equals(parent, casted.parent)
×
299
        && Objects.equals(itemStatus, casted.itemStatus);
×
300
  }
301

302
  @Override
303
  public int hashCode() {
304
    return Objects.hash(
×
305
        id,
306
        etag,
307
        type,
308
        sequenceId,
309
        name,
310
        sha1,
311
        fileVersion,
312
        description,
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() {
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
        TrashFileItemStatusField itemStatus) {
480
      super();
×
481
      this.id = id;
×
482
      this.sequenceId = sequenceId;
×
483
      this.sha1 = sha1;
×
484
      this.description = description;
×
485
      this.size = size;
×
486
      this.pathCollection = pathCollection;
×
487
      this.createdAt = createdAt;
×
488
      this.modifiedAt = modifiedAt;
×
489
      this.modifiedBy = modifiedBy;
×
490
      this.ownedBy = ownedBy;
×
NEW
491
      this.itemStatus = new EnumWrapper<TrashFileItemStatusField>(itemStatus);
×
492
      this.type = new EnumWrapper<TrashFileTypeField>(TrashFileTypeField.FILE);
×
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
        EnumWrapper<TrashFileItemStatusField> itemStatus) {
507
      super();
×
508
      this.id = id;
×
509
      this.sequenceId = sequenceId;
×
510
      this.sha1 = sha1;
×
511
      this.description = description;
×
512
      this.size = size;
×
513
      this.pathCollection = pathCollection;
×
514
      this.createdAt = createdAt;
×
515
      this.modifiedAt = modifiedAt;
×
516
      this.modifiedBy = modifiedBy;
×
517
      this.ownedBy = ownedBy;
×
NEW
518
      this.itemStatus = itemStatus;
×
519
      this.type = new EnumWrapper<TrashFileTypeField>(TrashFileTypeField.FILE);
×
520
    }
×
521

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

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

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

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

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

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

554
    public Builder purgedAt(Date purgedAt) {
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");
×
563
      return this;
×
564
    }
565

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

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

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

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

588
    public TrashFile build() {
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