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

box / box-java-sdk-gen / #355

11 Jul 2025 04:43PM UTC coverage: 38.141% (+2.6%) from 35.58%
#355

Pull #361

github

web-flow
Merge 112b63b24 into 426763c84
Pull Request #361: feat: Support common fields in Union in Java (box/box-codegen#758)

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

165 existing lines in 43 files now uncovered.

18569 of 48685 relevant lines covered (38.14%)

0.38 hits per line

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

8.86
/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.util.Date;
15
import java.util.Objects;
16

17
@JsonFilter("nullablePropertyFilter")
18
public class TrashFolder extends SerializableObject {
19

20
  protected final String id;
21

22
  @Nullable protected String etag;
23

24
  @JsonDeserialize(using = TrashFolderTypeField.TrashFolderTypeFieldDeserializer.class)
25
  @JsonSerialize(using = TrashFolderTypeField.TrashFolderTypeFieldSerializer.class)
26
  protected EnumWrapper<TrashFolderTypeField> type;
27

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

31
  protected final String name;
32

33
  @JsonProperty("created_at")
34
  @JsonSerialize(using = DateTimeUtils.DateTimeSerializer.class)
35
  @JsonDeserialize(using = DateTimeUtils.DateTimeDeserializer.class)
36
  @Nullable
37
  protected Date createdAt;
38

39
  @JsonProperty("modified_at")
40
  @JsonSerialize(using = DateTimeUtils.DateTimeSerializer.class)
41
  @JsonDeserialize(using = DateTimeUtils.DateTimeDeserializer.class)
42
  @Nullable
43
  protected Date modifiedAt;
44

45
  protected final String description;
46

47
  protected final long size;
48

49
  @JsonProperty("path_collection")
50
  protected final TrashFolderPathCollectionField pathCollection;
51

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

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

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

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

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

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

82
  @JsonProperty("owned_by")
83
  protected final UserMini ownedBy;
84

85
  @JsonProperty("shared_link")
86
  @Nullable
87
  protected String sharedLink;
88

89
  @JsonProperty("folder_upload_email")
90
  @Nullable
91
  protected String folderUploadEmail;
92

93
  protected FolderMini parent;
94

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

100
  public TrashFolder(
101
      String id,
102
      String name,
103
      String description,
104
      long size,
105
      TrashFolderPathCollectionField pathCollection,
106
      UserMini createdBy,
107
      UserMini modifiedBy,
108
      UserMini ownedBy,
109
      TrashFolderItemStatusField itemStatus) {
UNCOV
110
    super();
×
UNCOV
111
    this.id = id;
×
UNCOV
112
    this.name = name;
×
UNCOV
113
    this.description = description;
×
UNCOV
114
    this.size = size;
×
UNCOV
115
    this.pathCollection = pathCollection;
×
UNCOV
116
    this.createdBy = createdBy;
×
UNCOV
117
    this.modifiedBy = modifiedBy;
×
UNCOV
118
    this.ownedBy = ownedBy;
×
NEW
119
    this.itemStatus = new EnumWrapper<TrashFolderItemStatusField>(itemStatus);
×
UNCOV
120
    this.type = new EnumWrapper<TrashFolderTypeField>(TrashFolderTypeField.FOLDER);
×
UNCOV
121
  }
×
122

123
  public TrashFolder(
124
      @JsonProperty("id") String id,
125
      @JsonProperty("name") String name,
126
      @JsonProperty("description") String description,
127
      @JsonProperty("size") long size,
128
      @JsonProperty("path_collection") TrashFolderPathCollectionField pathCollection,
129
      @JsonProperty("created_by") UserMini createdBy,
130
      @JsonProperty("modified_by") UserMini modifiedBy,
131
      @JsonProperty("owned_by") UserMini ownedBy,
132
      @JsonProperty("item_status") EnumWrapper<TrashFolderItemStatusField> itemStatus) {
133
    super();
1✔
134
    this.id = id;
1✔
135
    this.name = name;
1✔
136
    this.description = description;
1✔
137
    this.size = size;
1✔
138
    this.pathCollection = pathCollection;
1✔
139
    this.createdBy = createdBy;
1✔
140
    this.modifiedBy = modifiedBy;
1✔
141
    this.ownedBy = ownedBy;
1✔
142
    this.itemStatus = itemStatus;
1✔
143
    this.type = new EnumWrapper<TrashFolderTypeField>(TrashFolderTypeField.FOLDER);
1✔
144
  }
1✔
145

146
  protected TrashFolder(Builder builder) {
147
    super();
×
148
    this.id = builder.id;
×
149
    this.etag = builder.etag;
×
150
    this.type = builder.type;
×
151
    this.sequenceId = builder.sequenceId;
×
152
    this.name = builder.name;
×
153
    this.createdAt = builder.createdAt;
×
154
    this.modifiedAt = builder.modifiedAt;
×
155
    this.description = builder.description;
×
156
    this.size = builder.size;
×
157
    this.pathCollection = builder.pathCollection;
×
158
    this.createdBy = builder.createdBy;
×
159
    this.modifiedBy = builder.modifiedBy;
×
160
    this.trashedAt = builder.trashedAt;
×
161
    this.purgedAt = builder.purgedAt;
×
162
    this.contentCreatedAt = builder.contentCreatedAt;
×
163
    this.contentModifiedAt = builder.contentModifiedAt;
×
164
    this.ownedBy = builder.ownedBy;
×
165
    this.sharedLink = builder.sharedLink;
×
166
    this.folderUploadEmail = builder.folderUploadEmail;
×
167
    this.parent = builder.parent;
×
168
    this.itemStatus = builder.itemStatus;
×
169
    markNullableFieldsAsSet(builder.getExplicitlySetNullableFields());
×
170
  }
×
171

172
  public String getId() {
173
    return id;
1✔
174
  }
175

176
  public String getEtag() {
177
    return etag;
×
178
  }
179

180
  public EnumWrapper<TrashFolderTypeField> getType() {
181
    return type;
×
182
  }
183

184
  public String getSequenceId() {
185
    return sequenceId;
×
186
  }
187

188
  public String getName() {
189
    return name;
1✔
190
  }
191

192
  public Date getCreatedAt() {
193
    return createdAt;
×
194
  }
195

196
  public Date getModifiedAt() {
197
    return modifiedAt;
×
198
  }
199

200
  public String getDescription() {
201
    return description;
×
202
  }
203

204
  public long getSize() {
205
    return size;
×
206
  }
207

208
  public TrashFolderPathCollectionField getPathCollection() {
209
    return pathCollection;
×
210
  }
211

212
  public UserMini getCreatedBy() {
213
    return createdBy;
×
214
  }
215

216
  public UserMini getModifiedBy() {
217
    return modifiedBy;
×
218
  }
219

220
  public Date getTrashedAt() {
221
    return trashedAt;
×
222
  }
223

224
  public Date getPurgedAt() {
225
    return purgedAt;
×
226
  }
227

228
  public Date getContentCreatedAt() {
229
    return contentCreatedAt;
×
230
  }
231

232
  public Date getContentModifiedAt() {
233
    return contentModifiedAt;
×
234
  }
235

236
  public UserMini getOwnedBy() {
237
    return ownedBy;
×
238
  }
239

240
  public String getSharedLink() {
241
    return sharedLink;
×
242
  }
243

244
  public String getFolderUploadEmail() {
245
    return folderUploadEmail;
×
246
  }
247

248
  public FolderMini getParent() {
249
    return parent;
×
250
  }
251

252
  public EnumWrapper<TrashFolderItemStatusField> getItemStatus() {
253
    return itemStatus;
×
254
  }
255

256
  @Override
257
  public boolean equals(Object o) {
258
    if (this == o) {
×
259
      return true;
×
260
    }
261
    if (o == null || getClass() != o.getClass()) {
×
262
      return false;
×
263
    }
264
    TrashFolder casted = (TrashFolder) o;
×
265
    return Objects.equals(id, casted.id)
×
266
        && Objects.equals(etag, casted.etag)
×
267
        && Objects.equals(type, casted.type)
×
268
        && Objects.equals(sequenceId, casted.sequenceId)
×
269
        && Objects.equals(name, casted.name)
×
270
        && Objects.equals(createdAt, casted.createdAt)
×
271
        && Objects.equals(modifiedAt, casted.modifiedAt)
×
272
        && Objects.equals(description, casted.description)
×
273
        && Objects.equals(size, casted.size)
×
274
        && Objects.equals(pathCollection, casted.pathCollection)
×
275
        && Objects.equals(createdBy, casted.createdBy)
×
276
        && Objects.equals(modifiedBy, casted.modifiedBy)
×
277
        && Objects.equals(trashedAt, casted.trashedAt)
×
278
        && Objects.equals(purgedAt, casted.purgedAt)
×
279
        && Objects.equals(contentCreatedAt, casted.contentCreatedAt)
×
280
        && Objects.equals(contentModifiedAt, casted.contentModifiedAt)
×
281
        && Objects.equals(ownedBy, casted.ownedBy)
×
282
        && Objects.equals(sharedLink, casted.sharedLink)
×
283
        && Objects.equals(folderUploadEmail, casted.folderUploadEmail)
×
284
        && Objects.equals(parent, casted.parent)
×
285
        && Objects.equals(itemStatus, casted.itemStatus);
×
286
  }
287

288
  @Override
289
  public int hashCode() {
290
    return Objects.hash(
×
291
        id,
292
        etag,
293
        type,
294
        sequenceId,
295
        name,
296
        createdAt,
297
        modifiedAt,
298
        description,
299
        size,
×
300
        pathCollection,
301
        createdBy,
302
        modifiedBy,
303
        trashedAt,
304
        purgedAt,
305
        contentCreatedAt,
306
        contentModifiedAt,
307
        ownedBy,
308
        sharedLink,
309
        folderUploadEmail,
310
        parent,
311
        itemStatus);
312
  }
313

314
  @Override
315
  public String toString() {
316
    return "TrashFolder{"
×
317
        + "id='"
318
        + id
319
        + '\''
320
        + ", "
321
        + "etag='"
322
        + etag
323
        + '\''
324
        + ", "
325
        + "type='"
326
        + type
327
        + '\''
328
        + ", "
329
        + "sequenceId='"
330
        + sequenceId
331
        + '\''
332
        + ", "
333
        + "name='"
334
        + name
335
        + '\''
336
        + ", "
337
        + "createdAt='"
338
        + createdAt
339
        + '\''
340
        + ", "
341
        + "modifiedAt='"
342
        + modifiedAt
343
        + '\''
344
        + ", "
345
        + "description='"
346
        + description
347
        + '\''
348
        + ", "
349
        + "size='"
350
        + size
351
        + '\''
352
        + ", "
353
        + "pathCollection='"
354
        + pathCollection
355
        + '\''
356
        + ", "
357
        + "createdBy='"
358
        + createdBy
359
        + '\''
360
        + ", "
361
        + "modifiedBy='"
362
        + modifiedBy
363
        + '\''
364
        + ", "
365
        + "trashedAt='"
366
        + trashedAt
367
        + '\''
368
        + ", "
369
        + "purgedAt='"
370
        + purgedAt
371
        + '\''
372
        + ", "
373
        + "contentCreatedAt='"
374
        + contentCreatedAt
375
        + '\''
376
        + ", "
377
        + "contentModifiedAt='"
378
        + contentModifiedAt
379
        + '\''
380
        + ", "
381
        + "ownedBy='"
382
        + ownedBy
383
        + '\''
384
        + ", "
385
        + "sharedLink='"
386
        + sharedLink
387
        + '\''
388
        + ", "
389
        + "folderUploadEmail='"
390
        + folderUploadEmail
391
        + '\''
392
        + ", "
393
        + "parent='"
394
        + parent
395
        + '\''
396
        + ", "
397
        + "itemStatus='"
398
        + itemStatus
399
        + '\''
400
        + "}";
401
  }
402

403
  public static class Builder extends NullableFieldTracker {
404

405
    protected final String id;
406

407
    protected String etag;
408

409
    protected EnumWrapper<TrashFolderTypeField> type;
410

411
    protected String sequenceId;
412

413
    protected final String name;
414

415
    protected Date createdAt;
416

417
    protected Date modifiedAt;
418

419
    protected final String description;
420

421
    protected final long size;
422

423
    protected final TrashFolderPathCollectionField pathCollection;
424

425
    protected final UserMini createdBy;
426

427
    protected final UserMini modifiedBy;
428

429
    protected Date trashedAt;
430

431
    protected Date purgedAt;
432

433
    protected Date contentCreatedAt;
434

435
    protected Date contentModifiedAt;
436

437
    protected final UserMini ownedBy;
438

439
    protected String sharedLink;
440

441
    protected String folderUploadEmail;
442

443
    protected FolderMini parent;
444

445
    protected final EnumWrapper<TrashFolderItemStatusField> itemStatus;
446

447
    public Builder(
448
        String id,
449
        String name,
450
        String description,
451
        long size,
452
        TrashFolderPathCollectionField pathCollection,
453
        UserMini createdBy,
454
        UserMini modifiedBy,
455
        UserMini ownedBy,
456
        TrashFolderItemStatusField itemStatus) {
457
      super();
×
458
      this.id = id;
×
459
      this.name = name;
×
460
      this.description = description;
×
461
      this.size = size;
×
462
      this.pathCollection = pathCollection;
×
463
      this.createdBy = createdBy;
×
464
      this.modifiedBy = modifiedBy;
×
465
      this.ownedBy = ownedBy;
×
NEW
466
      this.itemStatus = new EnumWrapper<TrashFolderItemStatusField>(itemStatus);
×
467
      this.type = new EnumWrapper<TrashFolderTypeField>(TrashFolderTypeField.FOLDER);
×
468
    }
×
469

470
    public Builder(
471
        String id,
472
        String name,
473
        String description,
474
        long size,
475
        TrashFolderPathCollectionField pathCollection,
476
        UserMini createdBy,
477
        UserMini modifiedBy,
478
        UserMini ownedBy,
479
        EnumWrapper<TrashFolderItemStatusField> itemStatus) {
480
      super();
×
481
      this.id = id;
×
482
      this.name = name;
×
483
      this.description = description;
×
484
      this.size = size;
×
485
      this.pathCollection = pathCollection;
×
486
      this.createdBy = createdBy;
×
487
      this.modifiedBy = modifiedBy;
×
488
      this.ownedBy = ownedBy;
×
NEW
489
      this.itemStatus = itemStatus;
×
490
      this.type = new EnumWrapper<TrashFolderTypeField>(TrashFolderTypeField.FOLDER);
×
491
    }
×
492

493
    public Builder etag(String etag) {
494
      this.etag = etag;
×
495
      this.markNullableFieldAsSet("etag");
×
496
      return this;
×
497
    }
498

499
    public Builder type(TrashFolderTypeField type) {
500
      this.type = new EnumWrapper<TrashFolderTypeField>(type);
×
501
      return this;
×
502
    }
503

504
    public Builder type(EnumWrapper<TrashFolderTypeField> type) {
505
      this.type = type;
×
506
      return this;
×
507
    }
508

509
    public Builder sequenceId(String sequenceId) {
510
      this.sequenceId = sequenceId;
×
511
      return this;
×
512
    }
513

514
    public Builder createdAt(Date createdAt) {
515
      this.createdAt = createdAt;
×
516
      this.markNullableFieldAsSet("created_at");
×
517
      return this;
×
518
    }
519

520
    public Builder modifiedAt(Date modifiedAt) {
521
      this.modifiedAt = modifiedAt;
×
522
      this.markNullableFieldAsSet("modified_at");
×
523
      return this;
×
524
    }
525

526
    public Builder trashedAt(Date trashedAt) {
527
      this.trashedAt = trashedAt;
×
528
      this.markNullableFieldAsSet("trashed_at");
×
529
      return this;
×
530
    }
531

532
    public Builder purgedAt(Date purgedAt) {
533
      this.purgedAt = purgedAt;
×
534
      this.markNullableFieldAsSet("purged_at");
×
535
      return this;
×
536
    }
537

538
    public Builder contentCreatedAt(Date contentCreatedAt) {
539
      this.contentCreatedAt = contentCreatedAt;
×
540
      this.markNullableFieldAsSet("content_created_at");
×
541
      return this;
×
542
    }
543

544
    public Builder contentModifiedAt(Date contentModifiedAt) {
545
      this.contentModifiedAt = contentModifiedAt;
×
546
      this.markNullableFieldAsSet("content_modified_at");
×
547
      return this;
×
548
    }
549

550
    public Builder sharedLink(String sharedLink) {
551
      this.sharedLink = sharedLink;
×
552
      this.markNullableFieldAsSet("shared_link");
×
553
      return this;
×
554
    }
555

556
    public Builder folderUploadEmail(String folderUploadEmail) {
557
      this.folderUploadEmail = folderUploadEmail;
×
558
      this.markNullableFieldAsSet("folder_upload_email");
×
559
      return this;
×
560
    }
561

562
    public Builder parent(FolderMini parent) {
563
      this.parent = parent;
×
564
      return this;
×
565
    }
566

567
    public TrashFolder build() {
568
      return new TrashFolder(this);
×
569
    }
570
  }
571
}
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