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

box / box-java-sdk / #4742

06 Aug 2025 12:44PM UTC coverage: 38.272% (-0.08%) from 38.352%
#4742

push

github

web-flow
chore: Adjust `github` workflows for legacy repos (box/box-codegen#772) (#1331)

19031 of 49725 relevant lines covered (38.27%)

0.38 hits per line

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

11.76
/src/main/java/com/box/sdkgen/schemas/file/File.java
1
package com.box.sdkgen.schemas.file;
2

3
import com.box.sdkgen.internal.Nullable;
4
import com.box.sdkgen.internal.utils.DateTimeUtils;
5
import com.box.sdkgen.schemas.filebase.FileBaseTypeField;
6
import com.box.sdkgen.schemas.filemini.FileMini;
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 File extends FileMini {
20

21
  protected String description;
22

23
  protected Long size;
24

25
  @JsonProperty("path_collection")
26
  protected FilePathCollectionField pathCollection;
27

28
  @JsonProperty("created_at")
29
  @JsonSerialize(using = DateTimeUtils.DateTimeSerializer.class)
30
  @JsonDeserialize(using = DateTimeUtils.DateTimeDeserializer.class)
31
  protected Date createdAt;
32

33
  @JsonProperty("modified_at")
34
  @JsonSerialize(using = DateTimeUtils.DateTimeSerializer.class)
35
  @JsonDeserialize(using = DateTimeUtils.DateTimeDeserializer.class)
36
  protected Date modifiedAt;
37

38
  @JsonProperty("trashed_at")
39
  @JsonSerialize(using = DateTimeUtils.DateTimeSerializer.class)
40
  @JsonDeserialize(using = DateTimeUtils.DateTimeDeserializer.class)
41
  @Nullable
42
  protected Date trashedAt;
43

44
  @JsonProperty("purged_at")
45
  @JsonSerialize(using = DateTimeUtils.DateTimeSerializer.class)
46
  @JsonDeserialize(using = DateTimeUtils.DateTimeDeserializer.class)
47
  @Nullable
48
  protected Date purgedAt;
49

50
  @JsonProperty("content_created_at")
51
  @JsonSerialize(using = DateTimeUtils.DateTimeSerializer.class)
52
  @JsonDeserialize(using = DateTimeUtils.DateTimeDeserializer.class)
53
  @Nullable
54
  protected Date contentCreatedAt;
55

56
  @JsonProperty("content_modified_at")
57
  @JsonSerialize(using = DateTimeUtils.DateTimeSerializer.class)
58
  @JsonDeserialize(using = DateTimeUtils.DateTimeDeserializer.class)
59
  @Nullable
60
  protected Date contentModifiedAt;
61

62
  @JsonProperty("created_by")
63
  protected UserMini createdBy;
64

65
  @JsonProperty("modified_by")
66
  protected UserMini modifiedBy;
67

68
  @JsonProperty("owned_by")
69
  protected UserMini ownedBy;
70

71
  @JsonProperty("shared_link")
72
  protected FileSharedLinkField sharedLink;
73

74
  @Nullable protected FolderMini parent;
75

76
  @JsonDeserialize(using = FileItemStatusField.FileItemStatusFieldDeserializer.class)
77
  @JsonSerialize(using = FileItemStatusField.FileItemStatusFieldSerializer.class)
78
  @JsonProperty("item_status")
79
  protected EnumWrapper<FileItemStatusField> itemStatus;
80

81
  public File(@JsonProperty("id") String id) {
82
    super(id);
1✔
83
  }
1✔
84

85
  protected File(Builder builder) {
86
    super(builder);
×
87
    this.description = builder.description;
×
88
    this.size = builder.size;
×
89
    this.pathCollection = builder.pathCollection;
×
90
    this.createdAt = builder.createdAt;
×
91
    this.modifiedAt = builder.modifiedAt;
×
92
    this.trashedAt = builder.trashedAt;
×
93
    this.purgedAt = builder.purgedAt;
×
94
    this.contentCreatedAt = builder.contentCreatedAt;
×
95
    this.contentModifiedAt = builder.contentModifiedAt;
×
96
    this.createdBy = builder.createdBy;
×
97
    this.modifiedBy = builder.modifiedBy;
×
98
    this.ownedBy = builder.ownedBy;
×
99
    this.sharedLink = builder.sharedLink;
×
100
    this.parent = builder.parent;
×
101
    this.itemStatus = builder.itemStatus;
×
102
    markNullableFieldsAsSet(builder.getExplicitlySetNullableFields());
×
103
  }
×
104

105
  public String getDescription() {
106
    return description;
1✔
107
  }
108

109
  public Long getSize() {
110
    return size;
1✔
111
  }
112

113
  public FilePathCollectionField getPathCollection() {
114
    return pathCollection;
×
115
  }
116

117
  public Date getCreatedAt() {
118
    return createdAt;
1✔
119
  }
120

121
  public Date getModifiedAt() {
122
    return modifiedAt;
1✔
123
  }
124

125
  public Date getTrashedAt() {
126
    return trashedAt;
1✔
127
  }
128

129
  public Date getPurgedAt() {
130
    return purgedAt;
1✔
131
  }
132

133
  public Date getContentCreatedAt() {
134
    return contentCreatedAt;
×
135
  }
136

137
  public Date getContentModifiedAt() {
138
    return contentModifiedAt;
×
139
  }
140

141
  public UserMini getCreatedBy() {
142
    return createdBy;
1✔
143
  }
144

145
  public UserMini getModifiedBy() {
146
    return modifiedBy;
1✔
147
  }
148

149
  public UserMini getOwnedBy() {
150
    return ownedBy;
1✔
151
  }
152

153
  public FileSharedLinkField getSharedLink() {
154
    return sharedLink;
1✔
155
  }
156

157
  public FolderMini getParent() {
158
    return parent;
1✔
159
  }
160

161
  public EnumWrapper<FileItemStatusField> getItemStatus() {
162
    return itemStatus;
1✔
163
  }
164

165
  @Override
166
  public boolean equals(Object o) {
167
    if (this == o) {
×
168
      return true;
×
169
    }
170
    if (o == null || getClass() != o.getClass()) {
×
171
      return false;
×
172
    }
173
    File casted = (File) o;
×
174
    return Objects.equals(id, casted.id)
×
175
        && Objects.equals(etag, casted.etag)
×
176
        && Objects.equals(type, casted.type)
×
177
        && Objects.equals(sequenceId, casted.sequenceId)
×
178
        && Objects.equals(name, casted.name)
×
179
        && Objects.equals(sha1, casted.sha1)
×
180
        && Objects.equals(fileVersion, casted.fileVersion)
×
181
        && Objects.equals(description, casted.description)
×
182
        && Objects.equals(size, casted.size)
×
183
        && Objects.equals(pathCollection, casted.pathCollection)
×
184
        && Objects.equals(createdAt, casted.createdAt)
×
185
        && Objects.equals(modifiedAt, casted.modifiedAt)
×
186
        && Objects.equals(trashedAt, casted.trashedAt)
×
187
        && Objects.equals(purgedAt, casted.purgedAt)
×
188
        && Objects.equals(contentCreatedAt, casted.contentCreatedAt)
×
189
        && Objects.equals(contentModifiedAt, casted.contentModifiedAt)
×
190
        && Objects.equals(createdBy, casted.createdBy)
×
191
        && Objects.equals(modifiedBy, casted.modifiedBy)
×
192
        && Objects.equals(ownedBy, casted.ownedBy)
×
193
        && Objects.equals(sharedLink, casted.sharedLink)
×
194
        && Objects.equals(parent, casted.parent)
×
195
        && Objects.equals(itemStatus, casted.itemStatus);
×
196
  }
197

198
  @Override
199
  public int hashCode() {
200
    return Objects.hash(
×
201
        id,
202
        etag,
203
        type,
204
        sequenceId,
205
        name,
206
        sha1,
207
        fileVersion,
208
        description,
209
        size,
210
        pathCollection,
211
        createdAt,
212
        modifiedAt,
213
        trashedAt,
214
        purgedAt,
215
        contentCreatedAt,
216
        contentModifiedAt,
217
        createdBy,
218
        modifiedBy,
219
        ownedBy,
220
        sharedLink,
221
        parent,
222
        itemStatus);
223
  }
224

225
  @Override
226
  public String toString() {
227
    return "File{"
×
228
        + "id='"
229
        + id
230
        + '\''
231
        + ", "
232
        + "etag='"
233
        + etag
234
        + '\''
235
        + ", "
236
        + "type='"
237
        + type
238
        + '\''
239
        + ", "
240
        + "sequenceId='"
241
        + sequenceId
242
        + '\''
243
        + ", "
244
        + "name='"
245
        + name
246
        + '\''
247
        + ", "
248
        + "sha1='"
249
        + sha1
250
        + '\''
251
        + ", "
252
        + "fileVersion='"
253
        + fileVersion
254
        + '\''
255
        + ", "
256
        + "description='"
257
        + description
258
        + '\''
259
        + ", "
260
        + "size='"
261
        + size
262
        + '\''
263
        + ", "
264
        + "pathCollection='"
265
        + pathCollection
266
        + '\''
267
        + ", "
268
        + "createdAt='"
269
        + createdAt
270
        + '\''
271
        + ", "
272
        + "modifiedAt='"
273
        + modifiedAt
274
        + '\''
275
        + ", "
276
        + "trashedAt='"
277
        + trashedAt
278
        + '\''
279
        + ", "
280
        + "purgedAt='"
281
        + purgedAt
282
        + '\''
283
        + ", "
284
        + "contentCreatedAt='"
285
        + contentCreatedAt
286
        + '\''
287
        + ", "
288
        + "contentModifiedAt='"
289
        + contentModifiedAt
290
        + '\''
291
        + ", "
292
        + "createdBy='"
293
        + createdBy
294
        + '\''
295
        + ", "
296
        + "modifiedBy='"
297
        + modifiedBy
298
        + '\''
299
        + ", "
300
        + "ownedBy='"
301
        + ownedBy
302
        + '\''
303
        + ", "
304
        + "sharedLink='"
305
        + sharedLink
306
        + '\''
307
        + ", "
308
        + "parent='"
309
        + parent
310
        + '\''
311
        + ", "
312
        + "itemStatus='"
313
        + itemStatus
314
        + '\''
315
        + "}";
316
  }
317

318
  public static class Builder extends FileMini.Builder {
319

320
    protected String description;
321

322
    protected Long size;
323

324
    protected FilePathCollectionField pathCollection;
325

326
    protected Date createdAt;
327

328
    protected Date modifiedAt;
329

330
    protected Date trashedAt;
331

332
    protected Date purgedAt;
333

334
    protected Date contentCreatedAt;
335

336
    protected Date contentModifiedAt;
337

338
    protected UserMini createdBy;
339

340
    protected UserMini modifiedBy;
341

342
    protected UserMini ownedBy;
343

344
    protected FileSharedLinkField sharedLink;
345

346
    protected FolderMini parent;
347

348
    protected EnumWrapper<FileItemStatusField> itemStatus;
349

350
    public Builder(String id) {
351
      super(id);
×
352
    }
×
353

354
    public Builder description(String description) {
355
      this.description = description;
×
356
      return this;
×
357
    }
358

359
    public Builder size(Long size) {
360
      this.size = size;
×
361
      return this;
×
362
    }
363

364
    public Builder pathCollection(FilePathCollectionField pathCollection) {
365
      this.pathCollection = pathCollection;
×
366
      return this;
×
367
    }
368

369
    public Builder createdAt(Date createdAt) {
370
      this.createdAt = createdAt;
×
371
      return this;
×
372
    }
373

374
    public Builder modifiedAt(Date modifiedAt) {
375
      this.modifiedAt = modifiedAt;
×
376
      return this;
×
377
    }
378

379
    public Builder trashedAt(Date trashedAt) {
380
      this.trashedAt = trashedAt;
×
381
      this.markNullableFieldAsSet("trashed_at");
×
382
      return this;
×
383
    }
384

385
    public Builder purgedAt(Date purgedAt) {
386
      this.purgedAt = purgedAt;
×
387
      this.markNullableFieldAsSet("purged_at");
×
388
      return this;
×
389
    }
390

391
    public Builder contentCreatedAt(Date contentCreatedAt) {
392
      this.contentCreatedAt = contentCreatedAt;
×
393
      this.markNullableFieldAsSet("content_created_at");
×
394
      return this;
×
395
    }
396

397
    public Builder contentModifiedAt(Date contentModifiedAt) {
398
      this.contentModifiedAt = contentModifiedAt;
×
399
      this.markNullableFieldAsSet("content_modified_at");
×
400
      return this;
×
401
    }
402

403
    public Builder createdBy(UserMini createdBy) {
404
      this.createdBy = createdBy;
×
405
      return this;
×
406
    }
407

408
    public Builder modifiedBy(UserMini modifiedBy) {
409
      this.modifiedBy = modifiedBy;
×
410
      return this;
×
411
    }
412

413
    public Builder ownedBy(UserMini ownedBy) {
414
      this.ownedBy = ownedBy;
×
415
      return this;
×
416
    }
417

418
    public Builder sharedLink(FileSharedLinkField sharedLink) {
419
      this.sharedLink = sharedLink;
×
420
      return this;
×
421
    }
422

423
    public Builder parent(FolderMini parent) {
424
      this.parent = parent;
×
425
      this.markNullableFieldAsSet("parent");
×
426
      return this;
×
427
    }
428

429
    public Builder itemStatus(FileItemStatusField itemStatus) {
430
      this.itemStatus = new EnumWrapper<FileItemStatusField>(itemStatus);
×
431
      return this;
×
432
    }
433

434
    public Builder itemStatus(EnumWrapper<FileItemStatusField> itemStatus) {
435
      this.itemStatus = itemStatus;
×
436
      return this;
×
437
    }
438

439
    @Override
440
    public Builder etag(String etag) {
441
      this.etag = etag;
×
442
      this.markNullableFieldAsSet("etag");
×
443
      return this;
×
444
    }
445

446
    @Override
447
    public Builder type(FileBaseTypeField type) {
448
      this.type = new EnumWrapper<FileBaseTypeField>(type);
×
449
      return this;
×
450
    }
451

452
    @Override
453
    public Builder type(EnumWrapper<FileBaseTypeField> type) {
454
      this.type = type;
×
455
      return this;
×
456
    }
457

458
    @Override
459
    public Builder sequenceId(String sequenceId) {
460
      this.sequenceId = sequenceId;
×
461
      return this;
×
462
    }
463

464
    @Override
465
    public Builder name(String name) {
466
      this.name = name;
×
467
      return this;
×
468
    }
469

470
    @Override
471
    public Builder sha1(String sha1) {
472
      this.sha1 = sha1;
×
473
      return this;
×
474
    }
475

476
    @Override
477
    public Builder fileVersion(FileVersionMini fileVersion) {
478
      this.fileVersion = fileVersion;
×
479
      return this;
×
480
    }
481

482
    public File build() {
483
      return new File(this);
×
484
    }
485
  }
486
}
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