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

box / box-java-sdk / #6243

10 Feb 2026 05:27PM UTC coverage: 18.192% (-17.5%) from 35.714%
#6243

push

github

web-flow
fix(boxsdkgen): Move assigning default values from builder constructor to `build()` method (box/box-codegen#922) (#1712)

0 of 1677 new or added lines in 569 files covered. (0.0%)

2147 existing lines in 545 files now uncovered.

7388 of 40611 relevant lines covered (18.19%)

0.21 hits per line

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

0.0
/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.time.OffsetDateTime;
16
import java.util.Objects;
17

18
/** Represents a trashed file. */
19
@JsonFilter("nullablePropertyFilter")
20
public class TrashFile extends SerializableObject {
21

22
  /**
23
   * The unique identifier that represent a file.
24
   *
25
   * <p>The ID for any file can be determined by visiting a file in the web application and copying
26
   * the ID from the URL. For example, for the URL `https://*.app.box.com/files/123` the `file_id`
27
   * is `123`.
28
   */
29
  protected final String id;
30

31
  /**
32
   * The HTTP `etag` of this file. This can be used within some API endpoints in the `If-Match` and
33
   * `If-None-Match` headers to only perform changes on the file if (no) changes have happened.
34
   */
35
  @Nullable protected String etag;
36

37
  /** The value will always be `file`. */
38
  @JsonDeserialize(using = TrashFileTypeField.TrashFileTypeFieldDeserializer.class)
39
  @JsonSerialize(using = TrashFileTypeField.TrashFileTypeFieldSerializer.class)
40
  protected EnumWrapper<TrashFileTypeField> type;
41

42
  @JsonProperty("sequence_id")
43
  protected final String sequenceId;
44

45
  /** The name of the file. */
46
  protected String name;
47

48
  /**
49
   * The SHA1 hash of the file. This can be used to compare the contents of a file on Box with a
50
   * local file.
51
   */
52
  protected final String sha1;
53

54
  @JsonProperty("file_version")
55
  protected FileVersionMini fileVersion;
56

57
  /** The optional description of this file. */
58
  protected final String description;
59

60
  /**
61
   * The file size in bytes. Be careful parsing this integer as it can get very large and cause an
62
   * integer overflow.
63
   */
64
  protected final long size;
65

66
  @JsonProperty("path_collection")
67
  protected final TrashFilePathCollectionField pathCollection;
68

69
  /** The date and time when the file was created on Box. */
70
  @JsonProperty("created_at")
71
  @JsonSerialize(using = DateTimeUtils.DateTimeSerializer.class)
72
  @JsonDeserialize(using = DateTimeUtils.DateTimeDeserializer.class)
73
  protected final OffsetDateTime createdAt;
74

75
  /** The date and time when the file was last updated on Box. */
76
  @JsonProperty("modified_at")
77
  @JsonSerialize(using = DateTimeUtils.DateTimeSerializer.class)
78
  @JsonDeserialize(using = DateTimeUtils.DateTimeDeserializer.class)
79
  protected final OffsetDateTime modifiedAt;
80

81
  /** The time at which this file was put in the trash. */
82
  @JsonProperty("trashed_at")
83
  @JsonSerialize(using = DateTimeUtils.DateTimeSerializer.class)
84
  @JsonDeserialize(using = DateTimeUtils.DateTimeDeserializer.class)
85
  @Nullable
86
  protected OffsetDateTime trashedAt;
87

88
  /** The time at which this file is expected to be purged from the trash. */
89
  @JsonProperty("purged_at")
90
  @JsonSerialize(using = DateTimeUtils.DateTimeSerializer.class)
91
  @JsonDeserialize(using = DateTimeUtils.DateTimeDeserializer.class)
92
  @Nullable
93
  protected OffsetDateTime purgedAt;
94

95
  /**
96
   * The date and time at which this file was originally created, which might be before it was
97
   * uploaded to Box.
98
   */
99
  @JsonProperty("content_created_at")
100
  @JsonSerialize(using = DateTimeUtils.DateTimeSerializer.class)
101
  @JsonDeserialize(using = DateTimeUtils.DateTimeDeserializer.class)
102
  @Nullable
103
  protected OffsetDateTime contentCreatedAt;
104

105
  /**
106
   * The date and time at which this file was last updated, which might be before it was uploaded to
107
   * Box.
108
   */
109
  @JsonProperty("content_modified_at")
110
  @JsonSerialize(using = DateTimeUtils.DateTimeSerializer.class)
111
  @JsonDeserialize(using = DateTimeUtils.DateTimeDeserializer.class)
112
  @Nullable
113
  protected OffsetDateTime contentModifiedAt;
114

115
  @JsonProperty("created_by")
116
  protected UserMini createdBy;
117

118
  @JsonProperty("modified_by")
119
  protected final UserMini modifiedBy;
120

121
  @JsonProperty("owned_by")
122
  protected final UserMini ownedBy;
123

124
  /**
125
   * The shared link for this file. This will be `null` if a file has been trashed, since the link
126
   * will no longer be active.
127
   */
128
  @JsonProperty("shared_link")
129
  @Nullable
130
  protected String sharedLink;
131

132
  protected FolderMini parent;
133

134
  /**
135
   * Defines if this item has been deleted or not.
136
   *
137
   * <p>* `active` when the item has is not in the trash * `trashed` when the item has been moved to
138
   * the trash but not deleted * `deleted` when the item has been permanently deleted.
139
   */
140
  @JsonDeserialize(using = TrashFileItemStatusField.TrashFileItemStatusFieldDeserializer.class)
141
  @JsonSerialize(using = TrashFileItemStatusField.TrashFileItemStatusFieldSerializer.class)
142
  @JsonProperty("item_status")
143
  protected final EnumWrapper<TrashFileItemStatusField> itemStatus;
144

145
  public TrashFile(
146
      String id,
147
      String sequenceId,
148
      String sha1,
149
      String description,
150
      long size,
151
      TrashFilePathCollectionField pathCollection,
152
      OffsetDateTime createdAt,
153
      OffsetDateTime modifiedAt,
154
      UserMini modifiedBy,
155
      UserMini ownedBy,
156
      TrashFileItemStatusField itemStatus) {
157
    super();
×
158
    this.id = id;
×
159
    this.sequenceId = sequenceId;
×
160
    this.sha1 = sha1;
×
161
    this.description = description;
×
162
    this.size = size;
×
163
    this.pathCollection = pathCollection;
×
164
    this.createdAt = createdAt;
×
165
    this.modifiedAt = modifiedAt;
×
166
    this.modifiedBy = modifiedBy;
×
167
    this.ownedBy = ownedBy;
×
168
    this.itemStatus = new EnumWrapper<TrashFileItemStatusField>(itemStatus);
×
169
    this.type = new EnumWrapper<TrashFileTypeField>(TrashFileTypeField.FILE);
×
170
  }
×
171

172
  public TrashFile(
173
      @JsonProperty("id") String id,
174
      @JsonProperty("sequence_id") String sequenceId,
175
      @JsonProperty("sha1") String sha1,
176
      @JsonProperty("description") String description,
177
      @JsonProperty("size") long size,
178
      @JsonProperty("path_collection") TrashFilePathCollectionField pathCollection,
179
      @JsonProperty("created_at") OffsetDateTime createdAt,
180
      @JsonProperty("modified_at") OffsetDateTime modifiedAt,
181
      @JsonProperty("modified_by") UserMini modifiedBy,
182
      @JsonProperty("owned_by") UserMini ownedBy,
183
      @JsonProperty("item_status") EnumWrapper<TrashFileItemStatusField> itemStatus) {
184
    super();
×
185
    this.id = id;
×
186
    this.sequenceId = sequenceId;
×
187
    this.sha1 = sha1;
×
188
    this.description = description;
×
189
    this.size = size;
×
190
    this.pathCollection = pathCollection;
×
191
    this.createdAt = createdAt;
×
192
    this.modifiedAt = modifiedAt;
×
193
    this.modifiedBy = modifiedBy;
×
194
    this.ownedBy = ownedBy;
×
195
    this.itemStatus = itemStatus;
×
196
    this.type = new EnumWrapper<TrashFileTypeField>(TrashFileTypeField.FILE);
×
197
  }
×
198

199
  protected TrashFile(Builder builder) {
200
    super();
×
201
    this.id = builder.id;
×
202
    this.etag = builder.etag;
×
203
    this.type = builder.type;
×
204
    this.sequenceId = builder.sequenceId;
×
205
    this.name = builder.name;
×
206
    this.sha1 = builder.sha1;
×
207
    this.fileVersion = builder.fileVersion;
×
208
    this.description = builder.description;
×
209
    this.size = builder.size;
×
210
    this.pathCollection = builder.pathCollection;
×
211
    this.createdAt = builder.createdAt;
×
212
    this.modifiedAt = builder.modifiedAt;
×
213
    this.trashedAt = builder.trashedAt;
×
214
    this.purgedAt = builder.purgedAt;
×
215
    this.contentCreatedAt = builder.contentCreatedAt;
×
216
    this.contentModifiedAt = builder.contentModifiedAt;
×
217
    this.createdBy = builder.createdBy;
×
218
    this.modifiedBy = builder.modifiedBy;
×
219
    this.ownedBy = builder.ownedBy;
×
220
    this.sharedLink = builder.sharedLink;
×
221
    this.parent = builder.parent;
×
222
    this.itemStatus = builder.itemStatus;
×
223
    markNullableFieldsAsSet(builder.getExplicitlySetNullableFields());
×
224
  }
×
225

226
  public String getId() {
227
    return id;
×
228
  }
229

230
  public String getEtag() {
231
    return etag;
×
232
  }
233

234
  public EnumWrapper<TrashFileTypeField> getType() {
235
    return type;
×
236
  }
237

238
  public String getSequenceId() {
239
    return sequenceId;
×
240
  }
241

242
  public String getName() {
243
    return name;
×
244
  }
245

246
  public String getSha1() {
247
    return sha1;
×
248
  }
249

250
  public FileVersionMini getFileVersion() {
251
    return fileVersion;
×
252
  }
253

254
  public String getDescription() {
255
    return description;
×
256
  }
257

258
  public long getSize() {
259
    return size;
×
260
  }
261

262
  public TrashFilePathCollectionField getPathCollection() {
263
    return pathCollection;
×
264
  }
265

266
  public OffsetDateTime getCreatedAt() {
267
    return createdAt;
×
268
  }
269

270
  public OffsetDateTime getModifiedAt() {
271
    return modifiedAt;
×
272
  }
273

274
  public OffsetDateTime getTrashedAt() {
275
    return trashedAt;
×
276
  }
277

278
  public OffsetDateTime getPurgedAt() {
279
    return purgedAt;
×
280
  }
281

282
  public OffsetDateTime getContentCreatedAt() {
283
    return contentCreatedAt;
×
284
  }
285

286
  public OffsetDateTime getContentModifiedAt() {
287
    return contentModifiedAt;
×
288
  }
289

290
  public UserMini getCreatedBy() {
291
    return createdBy;
×
292
  }
293

294
  public UserMini getModifiedBy() {
295
    return modifiedBy;
×
296
  }
297

298
  public UserMini getOwnedBy() {
299
    return ownedBy;
×
300
  }
301

302
  public String getSharedLink() {
303
    return sharedLink;
×
304
  }
305

306
  public FolderMini getParent() {
307
    return parent;
×
308
  }
309

310
  public EnumWrapper<TrashFileItemStatusField> getItemStatus() {
311
    return itemStatus;
×
312
  }
313

314
  @Override
315
  public boolean equals(Object o) {
316
    if (this == o) {
×
317
      return true;
×
318
    }
319
    if (o == null || getClass() != o.getClass()) {
×
320
      return false;
×
321
    }
322
    TrashFile casted = (TrashFile) o;
×
323
    return Objects.equals(id, casted.id)
×
324
        && Objects.equals(etag, casted.etag)
×
325
        && Objects.equals(type, casted.type)
×
326
        && Objects.equals(sequenceId, casted.sequenceId)
×
327
        && Objects.equals(name, casted.name)
×
328
        && Objects.equals(sha1, casted.sha1)
×
329
        && Objects.equals(fileVersion, casted.fileVersion)
×
330
        && Objects.equals(description, casted.description)
×
331
        && Objects.equals(size, casted.size)
×
332
        && Objects.equals(pathCollection, casted.pathCollection)
×
333
        && Objects.equals(createdAt, casted.createdAt)
×
334
        && Objects.equals(modifiedAt, casted.modifiedAt)
×
335
        && Objects.equals(trashedAt, casted.trashedAt)
×
336
        && Objects.equals(purgedAt, casted.purgedAt)
×
337
        && Objects.equals(contentCreatedAt, casted.contentCreatedAt)
×
338
        && Objects.equals(contentModifiedAt, casted.contentModifiedAt)
×
339
        && Objects.equals(createdBy, casted.createdBy)
×
340
        && Objects.equals(modifiedBy, casted.modifiedBy)
×
341
        && Objects.equals(ownedBy, casted.ownedBy)
×
342
        && Objects.equals(sharedLink, casted.sharedLink)
×
343
        && Objects.equals(parent, casted.parent)
×
344
        && Objects.equals(itemStatus, casted.itemStatus);
×
345
  }
346

347
  @Override
348
  public int hashCode() {
349
    return Objects.hash(
×
350
        id,
351
        etag,
352
        type,
353
        sequenceId,
354
        name,
355
        sha1,
356
        fileVersion,
357
        description,
358
        size,
×
359
        pathCollection,
360
        createdAt,
361
        modifiedAt,
362
        trashedAt,
363
        purgedAt,
364
        contentCreatedAt,
365
        contentModifiedAt,
366
        createdBy,
367
        modifiedBy,
368
        ownedBy,
369
        sharedLink,
370
        parent,
371
        itemStatus);
372
  }
373

374
  @Override
375
  public String toString() {
376
    return "TrashFile{"
×
377
        + "id='"
378
        + id
379
        + '\''
380
        + ", "
381
        + "etag='"
382
        + etag
383
        + '\''
384
        + ", "
385
        + "type='"
386
        + type
387
        + '\''
388
        + ", "
389
        + "sequenceId='"
390
        + sequenceId
391
        + '\''
392
        + ", "
393
        + "name='"
394
        + name
395
        + '\''
396
        + ", "
397
        + "sha1='"
398
        + sha1
399
        + '\''
400
        + ", "
401
        + "fileVersion='"
402
        + fileVersion
403
        + '\''
404
        + ", "
405
        + "description='"
406
        + description
407
        + '\''
408
        + ", "
409
        + "size='"
410
        + size
411
        + '\''
412
        + ", "
413
        + "pathCollection='"
414
        + pathCollection
415
        + '\''
416
        + ", "
417
        + "createdAt='"
418
        + createdAt
419
        + '\''
420
        + ", "
421
        + "modifiedAt='"
422
        + modifiedAt
423
        + '\''
424
        + ", "
425
        + "trashedAt='"
426
        + trashedAt
427
        + '\''
428
        + ", "
429
        + "purgedAt='"
430
        + purgedAt
431
        + '\''
432
        + ", "
433
        + "contentCreatedAt='"
434
        + contentCreatedAt
435
        + '\''
436
        + ", "
437
        + "contentModifiedAt='"
438
        + contentModifiedAt
439
        + '\''
440
        + ", "
441
        + "createdBy='"
442
        + createdBy
443
        + '\''
444
        + ", "
445
        + "modifiedBy='"
446
        + modifiedBy
447
        + '\''
448
        + ", "
449
        + "ownedBy='"
450
        + ownedBy
451
        + '\''
452
        + ", "
453
        + "sharedLink='"
454
        + sharedLink
455
        + '\''
456
        + ", "
457
        + "parent='"
458
        + parent
459
        + '\''
460
        + ", "
461
        + "itemStatus='"
462
        + itemStatus
463
        + '\''
464
        + "}";
465
  }
466

467
  public static class Builder extends NullableFieldTracker {
468

469
    protected final String id;
470

471
    protected String etag;
472

473
    protected EnumWrapper<TrashFileTypeField> type;
474

475
    protected final String sequenceId;
476

477
    protected String name;
478

479
    protected final String sha1;
480

481
    protected FileVersionMini fileVersion;
482

483
    protected final String description;
484

485
    protected final long size;
486

487
    protected final TrashFilePathCollectionField pathCollection;
488

489
    protected final OffsetDateTime createdAt;
490

491
    protected final OffsetDateTime modifiedAt;
492

493
    protected OffsetDateTime trashedAt;
494

495
    protected OffsetDateTime purgedAt;
496

497
    protected OffsetDateTime contentCreatedAt;
498

499
    protected OffsetDateTime contentModifiedAt;
500

501
    protected UserMini createdBy;
502

503
    protected final UserMini modifiedBy;
504

505
    protected final UserMini ownedBy;
506

507
    protected String sharedLink;
508

509
    protected FolderMini parent;
510

511
    protected final EnumWrapper<TrashFileItemStatusField> itemStatus;
512

513
    public Builder(
514
        String id,
515
        String sequenceId,
516
        String sha1,
517
        String description,
518
        long size,
519
        TrashFilePathCollectionField pathCollection,
520
        OffsetDateTime createdAt,
521
        OffsetDateTime modifiedAt,
522
        UserMini modifiedBy,
523
        UserMini ownedBy,
524
        TrashFileItemStatusField itemStatus) {
525
      super();
×
526
      this.id = id;
×
527
      this.sequenceId = sequenceId;
×
528
      this.sha1 = sha1;
×
529
      this.description = description;
×
530
      this.size = size;
×
531
      this.pathCollection = pathCollection;
×
532
      this.createdAt = createdAt;
×
533
      this.modifiedAt = modifiedAt;
×
534
      this.modifiedBy = modifiedBy;
×
535
      this.ownedBy = ownedBy;
×
536
      this.itemStatus = new EnumWrapper<TrashFileItemStatusField>(itemStatus);
×
537
    }
×
538

539
    public Builder(
540
        String id,
541
        String sequenceId,
542
        String sha1,
543
        String description,
544
        long size,
545
        TrashFilePathCollectionField pathCollection,
546
        OffsetDateTime createdAt,
547
        OffsetDateTime modifiedAt,
548
        UserMini modifiedBy,
549
        UserMini ownedBy,
550
        EnumWrapper<TrashFileItemStatusField> itemStatus) {
551
      super();
×
552
      this.id = id;
×
553
      this.sequenceId = sequenceId;
×
554
      this.sha1 = sha1;
×
555
      this.description = description;
×
556
      this.size = size;
×
557
      this.pathCollection = pathCollection;
×
558
      this.createdAt = createdAt;
×
559
      this.modifiedAt = modifiedAt;
×
560
      this.modifiedBy = modifiedBy;
×
561
      this.ownedBy = ownedBy;
×
562
      this.itemStatus = itemStatus;
×
UNCOV
563
    }
×
564

565
    public Builder etag(String etag) {
566
      this.etag = etag;
×
UNCOV
567
      this.markNullableFieldAsSet("etag");
×
UNCOV
568
      return this;
×
569
    }
570

571
    public Builder type(TrashFileTypeField type) {
UNCOV
572
      this.type = new EnumWrapper<TrashFileTypeField>(type);
×
UNCOV
573
      return this;
×
574
    }
575

576
    public Builder type(EnumWrapper<TrashFileTypeField> type) {
UNCOV
577
      this.type = type;
×
UNCOV
578
      return this;
×
579
    }
580

581
    public Builder name(String name) {
UNCOV
582
      this.name = name;
×
UNCOV
583
      return this;
×
584
    }
585

586
    public Builder fileVersion(FileVersionMini fileVersion) {
UNCOV
587
      this.fileVersion = fileVersion;
×
UNCOV
588
      return this;
×
589
    }
590

591
    public Builder trashedAt(OffsetDateTime trashedAt) {
592
      this.trashedAt = trashedAt;
×
UNCOV
593
      this.markNullableFieldAsSet("trashed_at");
×
UNCOV
594
      return this;
×
595
    }
596

597
    public Builder purgedAt(OffsetDateTime purgedAt) {
598
      this.purgedAt = purgedAt;
×
UNCOV
599
      this.markNullableFieldAsSet("purged_at");
×
UNCOV
600
      return this;
×
601
    }
602

603
    public Builder contentCreatedAt(OffsetDateTime contentCreatedAt) {
604
      this.contentCreatedAt = contentCreatedAt;
×
UNCOV
605
      this.markNullableFieldAsSet("content_created_at");
×
UNCOV
606
      return this;
×
607
    }
608

609
    public Builder contentModifiedAt(OffsetDateTime contentModifiedAt) {
610
      this.contentModifiedAt = contentModifiedAt;
×
UNCOV
611
      this.markNullableFieldAsSet("content_modified_at");
×
UNCOV
612
      return this;
×
613
    }
614

615
    public Builder createdBy(UserMini createdBy) {
UNCOV
616
      this.createdBy = createdBy;
×
UNCOV
617
      return this;
×
618
    }
619

620
    public Builder sharedLink(String sharedLink) {
621
      this.sharedLink = sharedLink;
×
UNCOV
622
      this.markNullableFieldAsSet("shared_link");
×
UNCOV
623
      return this;
×
624
    }
625

626
    public Builder parent(FolderMini parent) {
UNCOV
627
      this.parent = parent;
×
UNCOV
628
      return this;
×
629
    }
630

631
    public TrashFile build() {
NEW
632
      if (this.type == null) {
×
NEW
633
        this.type = new EnumWrapper<TrashFileTypeField>(TrashFileTypeField.FILE);
×
634
      }
635
      return new TrashFile(this);
×
636
    }
637
  }
638
}
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