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

box / box-java-sdk / #5076

07 Oct 2025 12:35PM UTC coverage: 37.132% (+0.007%) from 37.125%
#5076

push

github

web-flow
test: Change `Event.additionalDetails` field assertion in events test (box/box-codegen#858) (#1491)

18454 of 49699 relevant lines covered (37.13%)

0.37 hits per line

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

10.24
/src/main/java/com/box/sdkgen/schemas/folder/Folder.java
1
package com.box.sdkgen.schemas.folder;
2

3
import com.box.sdkgen.internal.Nullable;
4
import com.box.sdkgen.internal.utils.DateTimeUtils;
5
import com.box.sdkgen.schemas.folderbase.FolderBaseTypeField;
6
import com.box.sdkgen.schemas.foldermini.FolderMini;
7
import com.box.sdkgen.schemas.items.Items;
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
/** A standard representation of a folder, as returned from any folder API endpoints by default. */
18
@JsonFilter("nullablePropertyFilter")
19
public class Folder extends FolderMini {
20

21
  /**
22
   * The date and time when the folder was created. This value may be `null` for some folders such
23
   * as the root folder or the trash folder.
24
   */
25
  @JsonProperty("created_at")
26
  @JsonSerialize(using = DateTimeUtils.DateTimeSerializer.class)
27
  @JsonDeserialize(using = DateTimeUtils.DateTimeDeserializer.class)
28
  @Nullable
29
  protected OffsetDateTime createdAt;
30

31
  /**
32
   * The date and time when the folder was last updated. This value may be `null` for some folders
33
   * such as the root folder or the trash folder.
34
   */
35
  @JsonProperty("modified_at")
36
  @JsonSerialize(using = DateTimeUtils.DateTimeSerializer.class)
37
  @JsonDeserialize(using = DateTimeUtils.DateTimeDeserializer.class)
38
  @Nullable
39
  protected OffsetDateTime modifiedAt;
40

41
  protected String description;
42

43
  /**
44
   * The folder size in bytes.
45
   *
46
   * <p>Be careful parsing this integer as its value can get very large.
47
   */
48
  protected Long size;
49

50
  @JsonProperty("path_collection")
51
  protected FolderPathCollectionField pathCollection;
52

53
  @JsonProperty("created_by")
54
  protected UserMini createdBy;
55

56
  @JsonProperty("modified_by")
57
  protected UserMini modifiedBy;
58

59
  /** The time at which this folder was put in the trash. */
60
  @JsonProperty("trashed_at")
61
  @JsonSerialize(using = DateTimeUtils.DateTimeSerializer.class)
62
  @JsonDeserialize(using = DateTimeUtils.DateTimeDeserializer.class)
63
  @Nullable
64
  protected OffsetDateTime trashedAt;
65

66
  /** The time at which this folder is expected to be purged from the trash. */
67
  @JsonProperty("purged_at")
68
  @JsonSerialize(using = DateTimeUtils.DateTimeSerializer.class)
69
  @JsonDeserialize(using = DateTimeUtils.DateTimeDeserializer.class)
70
  @Nullable
71
  protected OffsetDateTime purgedAt;
72

73
  /** The date and time at which this folder was originally created. */
74
  @JsonProperty("content_created_at")
75
  @JsonSerialize(using = DateTimeUtils.DateTimeSerializer.class)
76
  @JsonDeserialize(using = DateTimeUtils.DateTimeDeserializer.class)
77
  @Nullable
78
  protected OffsetDateTime contentCreatedAt;
79

80
  /** The date and time at which this folder was last updated. */
81
  @JsonProperty("content_modified_at")
82
  @JsonSerialize(using = DateTimeUtils.DateTimeSerializer.class)
83
  @JsonDeserialize(using = DateTimeUtils.DateTimeDeserializer.class)
84
  @Nullable
85
  protected OffsetDateTime contentModifiedAt;
86

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

90
  @JsonProperty("shared_link")
91
  @Nullable
92
  protected FolderSharedLinkField sharedLink;
93

94
  /**
95
   * The `folder_upload_email` parameter is not `null` if one of the following options is **true**:
96
   *
97
   * <p>* The **Allow uploads to this folder via email** and the **Only allow email uploads from
98
   * collaborators in this folder** are [enabled for a folder in the Admin
99
   * Console](https://support.box.com/hc/en-us/articles/360043697534-Upload-to-Box-Through-Email),
100
   * and the user has at least **Upload** permissions granted.
101
   *
102
   * <p>* The **Allow uploads to this folder via email** setting is enabled for a folder in the
103
   * Admin Console, and the **Only allow email uploads from collaborators in this folder** setting
104
   * is deactivated (unchecked).
105
   *
106
   * <p>If the conditions are not met, the parameter will have the following value:
107
   * `folder_upload_email: null`.
108
   */
109
  @JsonProperty("folder_upload_email")
110
  @Nullable
111
  protected FolderFolderUploadEmailField folderUploadEmail;
112

113
  @Nullable protected FolderMini parent;
114

115
  /**
116
   * Defines if this item has been deleted or not.
117
   *
118
   * <p>* `active` when the item has is not in the trash * `trashed` when the item has been moved to
119
   * the trash but not deleted * `deleted` when the item has been permanently deleted.
120
   */
121
  @JsonDeserialize(using = FolderItemStatusField.FolderItemStatusFieldDeserializer.class)
122
  @JsonSerialize(using = FolderItemStatusField.FolderItemStatusFieldSerializer.class)
123
  @JsonProperty("item_status")
124
  protected EnumWrapper<FolderItemStatusField> itemStatus;
125

126
  @JsonProperty("item_collection")
127
  protected Items itemCollection;
128

129
  public Folder(@JsonProperty("id") String id) {
130
    super(id);
1✔
131
  }
1✔
132

133
  protected Folder(Builder builder) {
134
    super(builder);
×
135
    this.createdAt = builder.createdAt;
×
136
    this.modifiedAt = builder.modifiedAt;
×
137
    this.description = builder.description;
×
138
    this.size = builder.size;
×
139
    this.pathCollection = builder.pathCollection;
×
140
    this.createdBy = builder.createdBy;
×
141
    this.modifiedBy = builder.modifiedBy;
×
142
    this.trashedAt = builder.trashedAt;
×
143
    this.purgedAt = builder.purgedAt;
×
144
    this.contentCreatedAt = builder.contentCreatedAt;
×
145
    this.contentModifiedAt = builder.contentModifiedAt;
×
146
    this.ownedBy = builder.ownedBy;
×
147
    this.sharedLink = builder.sharedLink;
×
148
    this.folderUploadEmail = builder.folderUploadEmail;
×
149
    this.parent = builder.parent;
×
150
    this.itemStatus = builder.itemStatus;
×
151
    this.itemCollection = builder.itemCollection;
×
152
    markNullableFieldsAsSet(builder.getExplicitlySetNullableFields());
×
153
  }
×
154

155
  public OffsetDateTime getCreatedAt() {
156
    return createdAt;
1✔
157
  }
158

159
  public OffsetDateTime getModifiedAt() {
160
    return modifiedAt;
1✔
161
  }
162

163
  public String getDescription() {
164
    return description;
1✔
165
  }
166

167
  public Long getSize() {
168
    return size;
×
169
  }
170

171
  public FolderPathCollectionField getPathCollection() {
172
    return pathCollection;
×
173
  }
174

175
  public UserMini getCreatedBy() {
176
    return createdBy;
1✔
177
  }
178

179
  public UserMini getModifiedBy() {
180
    return modifiedBy;
1✔
181
  }
182

183
  public OffsetDateTime getTrashedAt() {
184
    return trashedAt;
1✔
185
  }
186

187
  public OffsetDateTime getPurgedAt() {
188
    return purgedAt;
1✔
189
  }
190

191
  public OffsetDateTime getContentCreatedAt() {
192
    return contentCreatedAt;
×
193
  }
194

195
  public OffsetDateTime getContentModifiedAt() {
196
    return contentModifiedAt;
×
197
  }
198

199
  public UserMini getOwnedBy() {
200
    return ownedBy;
1✔
201
  }
202

203
  public FolderSharedLinkField getSharedLink() {
204
    return sharedLink;
1✔
205
  }
206

207
  public FolderFolderUploadEmailField getFolderUploadEmail() {
208
    return folderUploadEmail;
×
209
  }
210

211
  public FolderMini getParent() {
212
    return parent;
1✔
213
  }
214

215
  public EnumWrapper<FolderItemStatusField> getItemStatus() {
216
    return itemStatus;
1✔
217
  }
218

219
  public Items getItemCollection() {
220
    return itemCollection;
×
221
  }
222

223
  @Override
224
  public boolean equals(Object o) {
225
    if (this == o) {
×
226
      return true;
×
227
    }
228
    if (o == null || getClass() != o.getClass()) {
×
229
      return false;
×
230
    }
231
    Folder casted = (Folder) o;
×
232
    return Objects.equals(id, casted.id)
×
233
        && Objects.equals(etag, casted.etag)
×
234
        && Objects.equals(type, casted.type)
×
235
        && Objects.equals(sequenceId, casted.sequenceId)
×
236
        && Objects.equals(name, casted.name)
×
237
        && Objects.equals(createdAt, casted.createdAt)
×
238
        && Objects.equals(modifiedAt, casted.modifiedAt)
×
239
        && Objects.equals(description, casted.description)
×
240
        && Objects.equals(size, casted.size)
×
241
        && Objects.equals(pathCollection, casted.pathCollection)
×
242
        && Objects.equals(createdBy, casted.createdBy)
×
243
        && Objects.equals(modifiedBy, casted.modifiedBy)
×
244
        && Objects.equals(trashedAt, casted.trashedAt)
×
245
        && Objects.equals(purgedAt, casted.purgedAt)
×
246
        && Objects.equals(contentCreatedAt, casted.contentCreatedAt)
×
247
        && Objects.equals(contentModifiedAt, casted.contentModifiedAt)
×
248
        && Objects.equals(ownedBy, casted.ownedBy)
×
249
        && Objects.equals(sharedLink, casted.sharedLink)
×
250
        && Objects.equals(folderUploadEmail, casted.folderUploadEmail)
×
251
        && Objects.equals(parent, casted.parent)
×
252
        && Objects.equals(itemStatus, casted.itemStatus)
×
253
        && Objects.equals(itemCollection, casted.itemCollection);
×
254
  }
255

256
  @Override
257
  public int hashCode() {
258
    return Objects.hash(
×
259
        id,
260
        etag,
261
        type,
262
        sequenceId,
263
        name,
264
        createdAt,
265
        modifiedAt,
266
        description,
267
        size,
268
        pathCollection,
269
        createdBy,
270
        modifiedBy,
271
        trashedAt,
272
        purgedAt,
273
        contentCreatedAt,
274
        contentModifiedAt,
275
        ownedBy,
276
        sharedLink,
277
        folderUploadEmail,
278
        parent,
279
        itemStatus,
280
        itemCollection);
281
  }
282

283
  @Override
284
  public String toString() {
285
    return "Folder{"
×
286
        + "id='"
287
        + id
288
        + '\''
289
        + ", "
290
        + "etag='"
291
        + etag
292
        + '\''
293
        + ", "
294
        + "type='"
295
        + type
296
        + '\''
297
        + ", "
298
        + "sequenceId='"
299
        + sequenceId
300
        + '\''
301
        + ", "
302
        + "name='"
303
        + name
304
        + '\''
305
        + ", "
306
        + "createdAt='"
307
        + createdAt
308
        + '\''
309
        + ", "
310
        + "modifiedAt='"
311
        + modifiedAt
312
        + '\''
313
        + ", "
314
        + "description='"
315
        + description
316
        + '\''
317
        + ", "
318
        + "size='"
319
        + size
320
        + '\''
321
        + ", "
322
        + "pathCollection='"
323
        + pathCollection
324
        + '\''
325
        + ", "
326
        + "createdBy='"
327
        + createdBy
328
        + '\''
329
        + ", "
330
        + "modifiedBy='"
331
        + modifiedBy
332
        + '\''
333
        + ", "
334
        + "trashedAt='"
335
        + trashedAt
336
        + '\''
337
        + ", "
338
        + "purgedAt='"
339
        + purgedAt
340
        + '\''
341
        + ", "
342
        + "contentCreatedAt='"
343
        + contentCreatedAt
344
        + '\''
345
        + ", "
346
        + "contentModifiedAt='"
347
        + contentModifiedAt
348
        + '\''
349
        + ", "
350
        + "ownedBy='"
351
        + ownedBy
352
        + '\''
353
        + ", "
354
        + "sharedLink='"
355
        + sharedLink
356
        + '\''
357
        + ", "
358
        + "folderUploadEmail='"
359
        + folderUploadEmail
360
        + '\''
361
        + ", "
362
        + "parent='"
363
        + parent
364
        + '\''
365
        + ", "
366
        + "itemStatus='"
367
        + itemStatus
368
        + '\''
369
        + ", "
370
        + "itemCollection='"
371
        + itemCollection
372
        + '\''
373
        + "}";
374
  }
375

376
  public static class Builder extends FolderMini.Builder {
377

378
    protected OffsetDateTime createdAt;
379

380
    protected OffsetDateTime modifiedAt;
381

382
    protected String description;
383

384
    protected Long size;
385

386
    protected FolderPathCollectionField pathCollection;
387

388
    protected UserMini createdBy;
389

390
    protected UserMini modifiedBy;
391

392
    protected OffsetDateTime trashedAt;
393

394
    protected OffsetDateTime purgedAt;
395

396
    protected OffsetDateTime contentCreatedAt;
397

398
    protected OffsetDateTime contentModifiedAt;
399

400
    protected UserMini ownedBy;
401

402
    protected FolderSharedLinkField sharedLink;
403

404
    protected FolderFolderUploadEmailField folderUploadEmail;
405

406
    protected FolderMini parent;
407

408
    protected EnumWrapper<FolderItemStatusField> itemStatus;
409

410
    protected Items itemCollection;
411

412
    public Builder(String id) {
413
      super(id);
×
414
    }
×
415

416
    public Builder createdAt(OffsetDateTime createdAt) {
417
      this.createdAt = createdAt;
×
418
      this.markNullableFieldAsSet("created_at");
×
419
      return this;
×
420
    }
421

422
    public Builder modifiedAt(OffsetDateTime modifiedAt) {
423
      this.modifiedAt = modifiedAt;
×
424
      this.markNullableFieldAsSet("modified_at");
×
425
      return this;
×
426
    }
427

428
    public Builder description(String description) {
429
      this.description = description;
×
430
      return this;
×
431
    }
432

433
    public Builder size(Long size) {
434
      this.size = size;
×
435
      return this;
×
436
    }
437

438
    public Builder pathCollection(FolderPathCollectionField pathCollection) {
439
      this.pathCollection = pathCollection;
×
440
      return this;
×
441
    }
442

443
    public Builder createdBy(UserMini createdBy) {
444
      this.createdBy = createdBy;
×
445
      return this;
×
446
    }
447

448
    public Builder modifiedBy(UserMini modifiedBy) {
449
      this.modifiedBy = modifiedBy;
×
450
      return this;
×
451
    }
452

453
    public Builder trashedAt(OffsetDateTime trashedAt) {
454
      this.trashedAt = trashedAt;
×
455
      this.markNullableFieldAsSet("trashed_at");
×
456
      return this;
×
457
    }
458

459
    public Builder purgedAt(OffsetDateTime purgedAt) {
460
      this.purgedAt = purgedAt;
×
461
      this.markNullableFieldAsSet("purged_at");
×
462
      return this;
×
463
    }
464

465
    public Builder contentCreatedAt(OffsetDateTime contentCreatedAt) {
466
      this.contentCreatedAt = contentCreatedAt;
×
467
      this.markNullableFieldAsSet("content_created_at");
×
468
      return this;
×
469
    }
470

471
    public Builder contentModifiedAt(OffsetDateTime contentModifiedAt) {
472
      this.contentModifiedAt = contentModifiedAt;
×
473
      this.markNullableFieldAsSet("content_modified_at");
×
474
      return this;
×
475
    }
476

477
    public Builder ownedBy(UserMini ownedBy) {
478
      this.ownedBy = ownedBy;
×
479
      return this;
×
480
    }
481

482
    public Builder sharedLink(FolderSharedLinkField sharedLink) {
483
      this.sharedLink = sharedLink;
×
484
      this.markNullableFieldAsSet("shared_link");
×
485
      return this;
×
486
    }
487

488
    public Builder folderUploadEmail(FolderFolderUploadEmailField folderUploadEmail) {
489
      this.folderUploadEmail = folderUploadEmail;
×
490
      this.markNullableFieldAsSet("folder_upload_email");
×
491
      return this;
×
492
    }
493

494
    public Builder parent(FolderMini parent) {
495
      this.parent = parent;
×
496
      this.markNullableFieldAsSet("parent");
×
497
      return this;
×
498
    }
499

500
    public Builder itemStatus(FolderItemStatusField itemStatus) {
501
      this.itemStatus = new EnumWrapper<FolderItemStatusField>(itemStatus);
×
502
      return this;
×
503
    }
504

505
    public Builder itemStatus(EnumWrapper<FolderItemStatusField> itemStatus) {
506
      this.itemStatus = itemStatus;
×
507
      return this;
×
508
    }
509

510
    public Builder itemCollection(Items itemCollection) {
511
      this.itemCollection = itemCollection;
×
512
      return this;
×
513
    }
514

515
    @Override
516
    public Builder etag(String etag) {
517
      this.etag = etag;
×
518
      this.markNullableFieldAsSet("etag");
×
519
      return this;
×
520
    }
521

522
    @Override
523
    public Builder type(FolderBaseTypeField type) {
524
      this.type = new EnumWrapper<FolderBaseTypeField>(type);
×
525
      return this;
×
526
    }
527

528
    @Override
529
    public Builder type(EnumWrapper<FolderBaseTypeField> type) {
530
      this.type = type;
×
531
      return this;
×
532
    }
533

534
    @Override
535
    public Builder sequenceId(String sequenceId) {
536
      this.sequenceId = sequenceId;
×
537
      return this;
×
538
    }
539

540
    @Override
541
    public Builder name(String name) {
542
      this.name = name;
×
543
      return this;
×
544
    }
545

546
    public Folder build() {
547
      return new Folder(this);
×
548
    }
549
  }
550
}
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