• 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/trashfolder/TrashFolder.java
1
package com.box.sdkgen.schemas.trashfolder;
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.foldermini.FolderMini;
8
import com.box.sdkgen.schemas.usermini.UserMini;
9
import com.box.sdkgen.serialization.json.EnumWrapper;
10
import com.fasterxml.jackson.annotation.JsonFilter;
11
import com.fasterxml.jackson.annotation.JsonProperty;
12
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
13
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
14
import java.time.OffsetDateTime;
15
import java.util.Objects;
16

17
/** Represents a trashed folder. */
18
@JsonFilter("nullablePropertyFilter")
19
public class TrashFolder extends SerializableObject {
20

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

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

37
  /** The value will always be `folder`. */
38
  @JsonDeserialize(using = TrashFolderTypeField.TrashFolderTypeFieldDeserializer.class)
39
  @JsonSerialize(using = TrashFolderTypeField.TrashFolderTypeFieldSerializer.class)
40
  protected EnumWrapper<TrashFolderTypeField> type;
41

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

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

48
  /**
49
   * The date and time when the folder was created. This value may be `null` for some folders such
50
   * as the root folder or the trash folder.
51
   */
52
  @JsonProperty("created_at")
53
  @JsonSerialize(using = DateTimeUtils.DateTimeSerializer.class)
54
  @JsonDeserialize(using = DateTimeUtils.DateTimeDeserializer.class)
55
  @Nullable
56
  protected OffsetDateTime createdAt;
57

58
  /**
59
   * The date and time when the folder was last updated. This value may be `null` for some folders
60
   * such as the root folder or the trash folder.
61
   */
62
  @JsonProperty("modified_at")
63
  @JsonSerialize(using = DateTimeUtils.DateTimeSerializer.class)
64
  @JsonDeserialize(using = DateTimeUtils.DateTimeDeserializer.class)
65
  @Nullable
66
  protected OffsetDateTime modifiedAt;
67

68
  protected final String description;
69

70
  /**
71
   * The folder size in bytes.
72
   *
73
   * <p>Be careful parsing this integer as its value can get very large.
74
   */
75
  protected final long size;
76

77
  @JsonProperty("path_collection")
78
  protected final TrashFolderPathCollectionField pathCollection;
79

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

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

86
  /** The time at which this folder was put in the trash. */
87
  @JsonProperty("trashed_at")
88
  @JsonSerialize(using = DateTimeUtils.DateTimeSerializer.class)
89
  @JsonDeserialize(using = DateTimeUtils.DateTimeDeserializer.class)
90
  @Nullable
91
  protected OffsetDateTime trashedAt;
92

93
  /** The time at which this folder is expected to be purged from the trash. */
94
  @JsonProperty("purged_at")
95
  @JsonSerialize(using = DateTimeUtils.DateTimeSerializer.class)
96
  @JsonDeserialize(using = DateTimeUtils.DateTimeDeserializer.class)
97
  @Nullable
98
  protected OffsetDateTime purgedAt;
99

100
  /** The date and time at which this folder was originally created. */
101
  @JsonProperty("content_created_at")
102
  @JsonSerialize(using = DateTimeUtils.DateTimeSerializer.class)
103
  @JsonDeserialize(using = DateTimeUtils.DateTimeDeserializer.class)
104
  @Nullable
105
  protected OffsetDateTime contentCreatedAt;
106

107
  /** The date and time at which this folder was last updated. */
108
  @JsonProperty("content_modified_at")
109
  @JsonSerialize(using = DateTimeUtils.DateTimeSerializer.class)
110
  @JsonDeserialize(using = DateTimeUtils.DateTimeDeserializer.class)
111
  @Nullable
112
  protected OffsetDateTime contentModifiedAt;
113

114
  @JsonProperty("owned_by")
115
  protected final UserMini ownedBy;
116

117
  /**
118
   * The shared link for this folder. This will be `null` if a folder has been trashed, since the
119
   * link will no longer be active.
120
   */
121
  @JsonProperty("shared_link")
122
  @Nullable
123
  protected String sharedLink;
124

125
  /**
126
   * The folder upload email for this folder. This will be `null` if a folder has been trashed,
127
   * since the upload will no longer work.
128
   */
129
  @JsonProperty("folder_upload_email")
130
  @Nullable
131
  protected String folderUploadEmail;
132

133
  protected FolderMini parent;
134

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

146
  public TrashFolder(
147
      String id,
148
      String name,
149
      String description,
150
      long size,
151
      TrashFolderPathCollectionField pathCollection,
152
      UserMini createdBy,
153
      UserMini modifiedBy,
154
      UserMini ownedBy,
155
      TrashFolderItemStatusField itemStatus) {
156
    super();
×
157
    this.id = id;
×
158
    this.name = name;
×
159
    this.description = description;
×
160
    this.size = size;
×
161
    this.pathCollection = pathCollection;
×
162
    this.createdBy = createdBy;
×
163
    this.modifiedBy = modifiedBy;
×
164
    this.ownedBy = ownedBy;
×
165
    this.itemStatus = new EnumWrapper<TrashFolderItemStatusField>(itemStatus);
×
166
    this.type = new EnumWrapper<TrashFolderTypeField>(TrashFolderTypeField.FOLDER);
×
167
  }
×
168

169
  public TrashFolder(
170
      @JsonProperty("id") String id,
171
      @JsonProperty("name") String name,
172
      @JsonProperty("description") String description,
173
      @JsonProperty("size") long size,
174
      @JsonProperty("path_collection") TrashFolderPathCollectionField pathCollection,
175
      @JsonProperty("created_by") UserMini createdBy,
176
      @JsonProperty("modified_by") UserMini modifiedBy,
177
      @JsonProperty("owned_by") UserMini ownedBy,
178
      @JsonProperty("item_status") EnumWrapper<TrashFolderItemStatusField> itemStatus) {
179
    super();
×
180
    this.id = id;
×
181
    this.name = name;
×
182
    this.description = description;
×
183
    this.size = size;
×
184
    this.pathCollection = pathCollection;
×
185
    this.createdBy = createdBy;
×
186
    this.modifiedBy = modifiedBy;
×
187
    this.ownedBy = ownedBy;
×
188
    this.itemStatus = itemStatus;
×
189
    this.type = new EnumWrapper<TrashFolderTypeField>(TrashFolderTypeField.FOLDER);
×
190
  }
×
191

192
  protected TrashFolder(Builder builder) {
193
    super();
×
194
    this.id = builder.id;
×
195
    this.etag = builder.etag;
×
196
    this.type = builder.type;
×
197
    this.sequenceId = builder.sequenceId;
×
198
    this.name = builder.name;
×
199
    this.createdAt = builder.createdAt;
×
200
    this.modifiedAt = builder.modifiedAt;
×
201
    this.description = builder.description;
×
202
    this.size = builder.size;
×
203
    this.pathCollection = builder.pathCollection;
×
204
    this.createdBy = builder.createdBy;
×
205
    this.modifiedBy = builder.modifiedBy;
×
206
    this.trashedAt = builder.trashedAt;
×
207
    this.purgedAt = builder.purgedAt;
×
208
    this.contentCreatedAt = builder.contentCreatedAt;
×
209
    this.contentModifiedAt = builder.contentModifiedAt;
×
210
    this.ownedBy = builder.ownedBy;
×
211
    this.sharedLink = builder.sharedLink;
×
212
    this.folderUploadEmail = builder.folderUploadEmail;
×
213
    this.parent = builder.parent;
×
214
    this.itemStatus = builder.itemStatus;
×
215
    markNullableFieldsAsSet(builder.getExplicitlySetNullableFields());
×
216
  }
×
217

218
  public String getId() {
219
    return id;
×
220
  }
221

222
  public String getEtag() {
223
    return etag;
×
224
  }
225

226
  public EnumWrapper<TrashFolderTypeField> getType() {
227
    return type;
×
228
  }
229

230
  public String getSequenceId() {
231
    return sequenceId;
×
232
  }
233

234
  public String getName() {
235
    return name;
×
236
  }
237

238
  public OffsetDateTime getCreatedAt() {
239
    return createdAt;
×
240
  }
241

242
  public OffsetDateTime getModifiedAt() {
243
    return modifiedAt;
×
244
  }
245

246
  public String getDescription() {
247
    return description;
×
248
  }
249

250
  public long getSize() {
251
    return size;
×
252
  }
253

254
  public TrashFolderPathCollectionField getPathCollection() {
255
    return pathCollection;
×
256
  }
257

258
  public UserMini getCreatedBy() {
259
    return createdBy;
×
260
  }
261

262
  public UserMini getModifiedBy() {
263
    return modifiedBy;
×
264
  }
265

266
  public OffsetDateTime getTrashedAt() {
267
    return trashedAt;
×
268
  }
269

270
  public OffsetDateTime getPurgedAt() {
271
    return purgedAt;
×
272
  }
273

274
  public OffsetDateTime getContentCreatedAt() {
275
    return contentCreatedAt;
×
276
  }
277

278
  public OffsetDateTime getContentModifiedAt() {
279
    return contentModifiedAt;
×
280
  }
281

282
  public UserMini getOwnedBy() {
283
    return ownedBy;
×
284
  }
285

286
  public String getSharedLink() {
287
    return sharedLink;
×
288
  }
289

290
  public String getFolderUploadEmail() {
291
    return folderUploadEmail;
×
292
  }
293

294
  public FolderMini getParent() {
295
    return parent;
×
296
  }
297

298
  public EnumWrapper<TrashFolderItemStatusField> getItemStatus() {
299
    return itemStatus;
×
300
  }
301

302
  @Override
303
  public boolean equals(Object o) {
304
    if (this == o) {
×
305
      return true;
×
306
    }
307
    if (o == null || getClass() != o.getClass()) {
×
308
      return false;
×
309
    }
310
    TrashFolder casted = (TrashFolder) o;
×
311
    return Objects.equals(id, casted.id)
×
312
        && Objects.equals(etag, casted.etag)
×
313
        && Objects.equals(type, casted.type)
×
314
        && Objects.equals(sequenceId, casted.sequenceId)
×
315
        && Objects.equals(name, casted.name)
×
316
        && Objects.equals(createdAt, casted.createdAt)
×
317
        && Objects.equals(modifiedAt, casted.modifiedAt)
×
318
        && Objects.equals(description, casted.description)
×
319
        && Objects.equals(size, casted.size)
×
320
        && Objects.equals(pathCollection, casted.pathCollection)
×
321
        && Objects.equals(createdBy, casted.createdBy)
×
322
        && Objects.equals(modifiedBy, casted.modifiedBy)
×
323
        && Objects.equals(trashedAt, casted.trashedAt)
×
324
        && Objects.equals(purgedAt, casted.purgedAt)
×
325
        && Objects.equals(contentCreatedAt, casted.contentCreatedAt)
×
326
        && Objects.equals(contentModifiedAt, casted.contentModifiedAt)
×
327
        && Objects.equals(ownedBy, casted.ownedBy)
×
328
        && Objects.equals(sharedLink, casted.sharedLink)
×
329
        && Objects.equals(folderUploadEmail, casted.folderUploadEmail)
×
330
        && Objects.equals(parent, casted.parent)
×
331
        && Objects.equals(itemStatus, casted.itemStatus);
×
332
  }
333

334
  @Override
335
  public int hashCode() {
336
    return Objects.hash(
×
337
        id,
338
        etag,
339
        type,
340
        sequenceId,
341
        name,
342
        createdAt,
343
        modifiedAt,
344
        description,
345
        size,
×
346
        pathCollection,
347
        createdBy,
348
        modifiedBy,
349
        trashedAt,
350
        purgedAt,
351
        contentCreatedAt,
352
        contentModifiedAt,
353
        ownedBy,
354
        sharedLink,
355
        folderUploadEmail,
356
        parent,
357
        itemStatus);
358
  }
359

360
  @Override
361
  public String toString() {
362
    return "TrashFolder{"
×
363
        + "id='"
364
        + id
365
        + '\''
366
        + ", "
367
        + "etag='"
368
        + etag
369
        + '\''
370
        + ", "
371
        + "type='"
372
        + type
373
        + '\''
374
        + ", "
375
        + "sequenceId='"
376
        + sequenceId
377
        + '\''
378
        + ", "
379
        + "name='"
380
        + name
381
        + '\''
382
        + ", "
383
        + "createdAt='"
384
        + createdAt
385
        + '\''
386
        + ", "
387
        + "modifiedAt='"
388
        + modifiedAt
389
        + '\''
390
        + ", "
391
        + "description='"
392
        + description
393
        + '\''
394
        + ", "
395
        + "size='"
396
        + size
397
        + '\''
398
        + ", "
399
        + "pathCollection='"
400
        + pathCollection
401
        + '\''
402
        + ", "
403
        + "createdBy='"
404
        + createdBy
405
        + '\''
406
        + ", "
407
        + "modifiedBy='"
408
        + modifiedBy
409
        + '\''
410
        + ", "
411
        + "trashedAt='"
412
        + trashedAt
413
        + '\''
414
        + ", "
415
        + "purgedAt='"
416
        + purgedAt
417
        + '\''
418
        + ", "
419
        + "contentCreatedAt='"
420
        + contentCreatedAt
421
        + '\''
422
        + ", "
423
        + "contentModifiedAt='"
424
        + contentModifiedAt
425
        + '\''
426
        + ", "
427
        + "ownedBy='"
428
        + ownedBy
429
        + '\''
430
        + ", "
431
        + "sharedLink='"
432
        + sharedLink
433
        + '\''
434
        + ", "
435
        + "folderUploadEmail='"
436
        + folderUploadEmail
437
        + '\''
438
        + ", "
439
        + "parent='"
440
        + parent
441
        + '\''
442
        + ", "
443
        + "itemStatus='"
444
        + itemStatus
445
        + '\''
446
        + "}";
447
  }
448

449
  public static class Builder extends NullableFieldTracker {
450

451
    protected final String id;
452

453
    protected String etag;
454

455
    protected EnumWrapper<TrashFolderTypeField> type;
456

457
    protected String sequenceId;
458

459
    protected final String name;
460

461
    protected OffsetDateTime createdAt;
462

463
    protected OffsetDateTime modifiedAt;
464

465
    protected final String description;
466

467
    protected final long size;
468

469
    protected final TrashFolderPathCollectionField pathCollection;
470

471
    protected final UserMini createdBy;
472

473
    protected final UserMini modifiedBy;
474

475
    protected OffsetDateTime trashedAt;
476

477
    protected OffsetDateTime purgedAt;
478

479
    protected OffsetDateTime contentCreatedAt;
480

481
    protected OffsetDateTime contentModifiedAt;
482

483
    protected final UserMini ownedBy;
484

485
    protected String sharedLink;
486

487
    protected String folderUploadEmail;
488

489
    protected FolderMini parent;
490

491
    protected final EnumWrapper<TrashFolderItemStatusField> itemStatus;
492

493
    public Builder(
494
        String id,
495
        String name,
496
        String description,
497
        long size,
498
        TrashFolderPathCollectionField pathCollection,
499
        UserMini createdBy,
500
        UserMini modifiedBy,
501
        UserMini ownedBy,
502
        TrashFolderItemStatusField itemStatus) {
503
      super();
×
504
      this.id = id;
×
505
      this.name = name;
×
506
      this.description = description;
×
507
      this.size = size;
×
508
      this.pathCollection = pathCollection;
×
509
      this.createdBy = createdBy;
×
510
      this.modifiedBy = modifiedBy;
×
511
      this.ownedBy = ownedBy;
×
512
      this.itemStatus = new EnumWrapper<TrashFolderItemStatusField>(itemStatus);
×
513
    }
×
514

515
    public Builder(
516
        String id,
517
        String name,
518
        String description,
519
        long size,
520
        TrashFolderPathCollectionField pathCollection,
521
        UserMini createdBy,
522
        UserMini modifiedBy,
523
        UserMini ownedBy,
524
        EnumWrapper<TrashFolderItemStatusField> itemStatus) {
525
      super();
×
526
      this.id = id;
×
527
      this.name = name;
×
528
      this.description = description;
×
529
      this.size = size;
×
530
      this.pathCollection = pathCollection;
×
531
      this.createdBy = createdBy;
×
532
      this.modifiedBy = modifiedBy;
×
533
      this.ownedBy = ownedBy;
×
534
      this.itemStatus = itemStatus;
×
UNCOV
535
    }
×
536

537
    public Builder etag(String etag) {
538
      this.etag = etag;
×
UNCOV
539
      this.markNullableFieldAsSet("etag");
×
UNCOV
540
      return this;
×
541
    }
542

543
    public Builder type(TrashFolderTypeField type) {
UNCOV
544
      this.type = new EnumWrapper<TrashFolderTypeField>(type);
×
UNCOV
545
      return this;
×
546
    }
547

548
    public Builder type(EnumWrapper<TrashFolderTypeField> type) {
UNCOV
549
      this.type = type;
×
UNCOV
550
      return this;
×
551
    }
552

553
    public Builder sequenceId(String sequenceId) {
UNCOV
554
      this.sequenceId = sequenceId;
×
UNCOV
555
      return this;
×
556
    }
557

558
    public Builder createdAt(OffsetDateTime createdAt) {
559
      this.createdAt = createdAt;
×
UNCOV
560
      this.markNullableFieldAsSet("created_at");
×
UNCOV
561
      return this;
×
562
    }
563

564
    public Builder modifiedAt(OffsetDateTime modifiedAt) {
565
      this.modifiedAt = modifiedAt;
×
UNCOV
566
      this.markNullableFieldAsSet("modified_at");
×
UNCOV
567
      return this;
×
568
    }
569

570
    public Builder trashedAt(OffsetDateTime trashedAt) {
571
      this.trashedAt = trashedAt;
×
UNCOV
572
      this.markNullableFieldAsSet("trashed_at");
×
UNCOV
573
      return this;
×
574
    }
575

576
    public Builder purgedAt(OffsetDateTime purgedAt) {
577
      this.purgedAt = purgedAt;
×
UNCOV
578
      this.markNullableFieldAsSet("purged_at");
×
UNCOV
579
      return this;
×
580
    }
581

582
    public Builder contentCreatedAt(OffsetDateTime contentCreatedAt) {
583
      this.contentCreatedAt = contentCreatedAt;
×
UNCOV
584
      this.markNullableFieldAsSet("content_created_at");
×
UNCOV
585
      return this;
×
586
    }
587

588
    public Builder contentModifiedAt(OffsetDateTime contentModifiedAt) {
589
      this.contentModifiedAt = contentModifiedAt;
×
UNCOV
590
      this.markNullableFieldAsSet("content_modified_at");
×
UNCOV
591
      return this;
×
592
    }
593

594
    public Builder sharedLink(String sharedLink) {
595
      this.sharedLink = sharedLink;
×
UNCOV
596
      this.markNullableFieldAsSet("shared_link");
×
UNCOV
597
      return this;
×
598
    }
599

600
    public Builder folderUploadEmail(String folderUploadEmail) {
601
      this.folderUploadEmail = folderUploadEmail;
×
UNCOV
602
      this.markNullableFieldAsSet("folder_upload_email");
×
UNCOV
603
      return this;
×
604
    }
605

606
    public Builder parent(FolderMini parent) {
UNCOV
607
      this.parent = parent;
×
UNCOV
608
      return this;
×
609
    }
610

611
    public TrashFolder build() {
NEW
612
      if (this.type == null) {
×
NEW
613
        this.type = new EnumWrapper<TrashFolderTypeField>(TrashFolderTypeField.FOLDER);
×
614
      }
615
      return new TrashFolder(this);
×
616
    }
617
  }
618
}
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