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

box / box-java-sdk-gen / #290

24 Jun 2025 01:20PM UTC coverage: 35.757% (+0.1%) from 35.632%
#290

Pull #347

github

web-flow
Merge 2c100d09c into d8480ee6c
Pull Request #347: feat: Add Webhook Validation In Java (box/box-codegen#745)

68 of 82 new or added lines in 2 files covered. (82.93%)

11777 existing lines in 624 files now uncovered.

16984 of 47499 relevant lines covered (35.76%)

0.36 hits per line

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

7.32
/src/main/java/com/box/sdkgen/schemas/fileversion/FileVersion.java
1
package com.box.sdkgen.schemas.fileversion;
2

3
import com.box.sdkgen.internal.Nullable;
4
import com.box.sdkgen.internal.utils.DateTimeUtils;
5
import com.box.sdkgen.schemas.fileversionbase.FileVersionBaseTypeField;
6
import com.box.sdkgen.schemas.fileversionmini.FileVersionMini;
7
import com.box.sdkgen.schemas.usermini.UserMini;
8
import com.box.sdkgen.serialization.json.EnumWrapper;
9
import com.fasterxml.jackson.annotation.JsonFilter;
10
import com.fasterxml.jackson.annotation.JsonProperty;
11
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
12
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
13
import java.util.Date;
14
import java.util.Objects;
15

16
@JsonFilter("nullablePropertyFilter")
17
public class FileVersion extends FileVersionMini {
18

19
  protected String name;
20

21
  protected Long size;
22

23
  @JsonProperty("created_at")
24
  @JsonSerialize(using = DateTimeUtils.DateTimeSerializer.class)
25
  @JsonDeserialize(using = DateTimeUtils.DateTimeDeserializer.class)
26
  protected Date createdAt;
27

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

33
  @JsonProperty("modified_by")
34
  protected UserMini modifiedBy;
35

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

42
  @JsonProperty("trashed_by")
43
  protected UserMini trashedBy;
44

45
  @JsonProperty("restored_at")
46
  @JsonSerialize(using = DateTimeUtils.DateTimeSerializer.class)
47
  @JsonDeserialize(using = DateTimeUtils.DateTimeDeserializer.class)
48
  @Nullable
49
  protected Date restoredAt;
50

51
  @JsonProperty("restored_by")
52
  protected UserMini restoredBy;
53

54
  @JsonProperty("purged_at")
55
  @JsonSerialize(using = DateTimeUtils.DateTimeSerializer.class)
56
  @JsonDeserialize(using = DateTimeUtils.DateTimeDeserializer.class)
57
  @Nullable
58
  protected Date purgedAt;
59

60
  @JsonProperty("uploader_display_name")
61
  protected String uploaderDisplayName;
62

63
  public FileVersion(@JsonProperty("id") String id) {
64
    super(id);
1✔
65
  }
1✔
66

67
  protected FileVersion(Builder builder) {
68
    super(builder);
×
69
    this.name = builder.name;
×
70
    this.size = builder.size;
×
71
    this.createdAt = builder.createdAt;
×
72
    this.modifiedAt = builder.modifiedAt;
×
73
    this.modifiedBy = builder.modifiedBy;
×
74
    this.trashedAt = builder.trashedAt;
×
UNCOV
75
    this.trashedBy = builder.trashedBy;
×
UNCOV
76
    this.restoredAt = builder.restoredAt;
×
77
    this.restoredBy = builder.restoredBy;
×
UNCOV
78
    this.purgedAt = builder.purgedAt;
×
UNCOV
79
    this.uploaderDisplayName = builder.uploaderDisplayName;
×
UNCOV
80
    markNullableFieldsAsSet(builder.getExplicitlySetNullableFields());
×
81
  }
×
82

83
  public String getName() {
UNCOV
84
    return name;
×
85
  }
86

87
  public Long getSize() {
UNCOV
88
    return size;
×
89
  }
90

91
  public Date getCreatedAt() {
UNCOV
92
    return createdAt;
×
93
  }
94

95
  public Date getModifiedAt() {
UNCOV
96
    return modifiedAt;
×
97
  }
98

99
  public UserMini getModifiedBy() {
UNCOV
100
    return modifiedBy;
×
101
  }
102

103
  public Date getTrashedAt() {
104
    return trashedAt;
1✔
105
  }
106

107
  public UserMini getTrashedBy() {
108
    return trashedBy;
1✔
109
  }
110

111
  public Date getRestoredAt() {
112
    return restoredAt;
1✔
113
  }
114

115
  public UserMini getRestoredBy() {
116
    return restoredBy;
1✔
117
  }
118

119
  public Date getPurgedAt() {
UNCOV
120
    return purgedAt;
×
121
  }
122

123
  public String getUploaderDisplayName() {
UNCOV
124
    return uploaderDisplayName;
×
125
  }
126

127
  @Override
128
  public boolean equals(Object o) {
129
    if (this == o) {
×
130
      return true;
×
131
    }
132
    if (o == null || getClass() != o.getClass()) {
×
133
      return false;
×
134
    }
135
    FileVersion casted = (FileVersion) o;
×
136
    return Objects.equals(id, casted.id)
×
137
        && Objects.equals(type, casted.type)
×
138
        && Objects.equals(sha1, casted.sha1)
×
139
        && Objects.equals(name, casted.name)
×
140
        && Objects.equals(size, casted.size)
×
141
        && Objects.equals(createdAt, casted.createdAt)
×
142
        && Objects.equals(modifiedAt, casted.modifiedAt)
×
UNCOV
143
        && Objects.equals(modifiedBy, casted.modifiedBy)
×
UNCOV
144
        && Objects.equals(trashedAt, casted.trashedAt)
×
UNCOV
145
        && Objects.equals(trashedBy, casted.trashedBy)
×
UNCOV
146
        && Objects.equals(restoredAt, casted.restoredAt)
×
147
        && Objects.equals(restoredBy, casted.restoredBy)
×
UNCOV
148
        && Objects.equals(purgedAt, casted.purgedAt)
×
UNCOV
149
        && Objects.equals(uploaderDisplayName, casted.uploaderDisplayName);
×
150
  }
151

152
  @Override
153
  public int hashCode() {
UNCOV
154
    return Objects.hash(
×
155
        id,
156
        type,
157
        sha1,
158
        name,
159
        size,
160
        createdAt,
161
        modifiedAt,
162
        modifiedBy,
163
        trashedAt,
164
        trashedBy,
165
        restoredAt,
166
        restoredBy,
167
        purgedAt,
168
        uploaderDisplayName);
169
  }
170

171
  @Override
172
  public String toString() {
UNCOV
173
    return "FileVersion{"
×
174
        + "id='"
175
        + id
176
        + '\''
177
        + ", "
178
        + "type='"
179
        + type
180
        + '\''
181
        + ", "
182
        + "sha1='"
183
        + sha1
184
        + '\''
185
        + ", "
186
        + "name='"
187
        + name
188
        + '\''
189
        + ", "
190
        + "size='"
191
        + size
192
        + '\''
193
        + ", "
194
        + "createdAt='"
195
        + createdAt
196
        + '\''
197
        + ", "
198
        + "modifiedAt='"
199
        + modifiedAt
200
        + '\''
201
        + ", "
202
        + "modifiedBy='"
203
        + modifiedBy
204
        + '\''
205
        + ", "
206
        + "trashedAt='"
207
        + trashedAt
208
        + '\''
209
        + ", "
210
        + "trashedBy='"
211
        + trashedBy
212
        + '\''
213
        + ", "
214
        + "restoredAt='"
215
        + restoredAt
216
        + '\''
217
        + ", "
218
        + "restoredBy='"
219
        + restoredBy
220
        + '\''
221
        + ", "
222
        + "purgedAt='"
223
        + purgedAt
224
        + '\''
225
        + ", "
226
        + "uploaderDisplayName='"
227
        + uploaderDisplayName
228
        + '\''
229
        + "}";
230
  }
231

232
  public static class Builder extends FileVersionMini.Builder {
233

234
    protected String name;
235

236
    protected Long size;
237

238
    protected Date createdAt;
239

240
    protected Date modifiedAt;
241

242
    protected UserMini modifiedBy;
243

244
    protected Date trashedAt;
245

246
    protected UserMini trashedBy;
247

248
    protected Date restoredAt;
249

250
    protected UserMini restoredBy;
251

252
    protected Date purgedAt;
253

254
    protected String uploaderDisplayName;
255

256
    public Builder(String id) {
UNCOV
257
      super(id);
×
UNCOV
258
    }
×
259

260
    public Builder name(String name) {
UNCOV
261
      this.name = name;
×
UNCOV
262
      return this;
×
263
    }
264

265
    public Builder size(Long size) {
UNCOV
266
      this.size = size;
×
UNCOV
267
      return this;
×
268
    }
269

270
    public Builder createdAt(Date createdAt) {
UNCOV
271
      this.createdAt = createdAt;
×
UNCOV
272
      return this;
×
273
    }
274

275
    public Builder modifiedAt(Date modifiedAt) {
UNCOV
276
      this.modifiedAt = modifiedAt;
×
UNCOV
277
      return this;
×
278
    }
279

280
    public Builder modifiedBy(UserMini modifiedBy) {
UNCOV
281
      this.modifiedBy = modifiedBy;
×
UNCOV
282
      return this;
×
283
    }
284

285
    public Builder trashedAt(Date trashedAt) {
UNCOV
286
      this.trashedAt = trashedAt;
×
UNCOV
287
      this.markNullableFieldAsSet("trashed_at");
×
UNCOV
288
      return this;
×
289
    }
290

291
    public Builder trashedBy(UserMini trashedBy) {
UNCOV
292
      this.trashedBy = trashedBy;
×
UNCOV
293
      return this;
×
294
    }
295

296
    public Builder restoredAt(Date restoredAt) {
UNCOV
297
      this.restoredAt = restoredAt;
×
UNCOV
298
      this.markNullableFieldAsSet("restored_at");
×
299
      return this;
×
300
    }
301

302
    public Builder restoredBy(UserMini restoredBy) {
UNCOV
303
      this.restoredBy = restoredBy;
×
304
      return this;
×
305
    }
306

307
    public Builder purgedAt(Date purgedAt) {
UNCOV
308
      this.purgedAt = purgedAt;
×
UNCOV
309
      this.markNullableFieldAsSet("purged_at");
×
310
      return this;
×
311
    }
312

313
    public Builder uploaderDisplayName(String uploaderDisplayName) {
UNCOV
314
      this.uploaderDisplayName = uploaderDisplayName;
×
UNCOV
315
      return this;
×
316
    }
317

318
    @Override
319
    public Builder type(FileVersionBaseTypeField type) {
UNCOV
320
      this.type = new EnumWrapper<FileVersionBaseTypeField>(type);
×
UNCOV
321
      return this;
×
322
    }
323

324
    @Override
325
    public Builder type(EnumWrapper<FileVersionBaseTypeField> type) {
UNCOV
326
      this.type = type;
×
327
      return this;
×
328
    }
329

330
    @Override
331
    public Builder sha1(String sha1) {
UNCOV
332
      this.sha1 = sha1;
×
UNCOV
333
      return this;
×
334
    }
335

336
    public FileVersion build() {
UNCOV
337
      return new FileVersion(this);
×
338
    }
339
  }
340
}
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