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

box / box-java-sdk-gen / #356

11 Jul 2025 04:43PM UTC coverage: 38.076% (+2.5%) from 35.58%
#356

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%)

167 existing lines in 45 files now uncovered.

18536 of 48681 relevant lines covered (38.08%)

0.38 hits per line

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

7.58
/src/main/java/com/box/sdkgen/schemas/file/FileSharedLinkField.java
1
package com.box.sdkgen.schemas.file;
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.serialization.json.EnumWrapper;
8
import com.fasterxml.jackson.annotation.JsonFilter;
9
import com.fasterxml.jackson.annotation.JsonProperty;
10
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
11
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
12
import java.util.Date;
13
import java.util.Objects;
14

15
@JsonFilter("nullablePropertyFilter")
16
public class FileSharedLinkField extends SerializableObject {
17

18
  protected final String url;
19

20
  @JsonProperty("download_url")
21
  @Nullable
22
  protected String downloadUrl;
23

24
  @JsonProperty("vanity_url")
25
  @Nullable
26
  protected String vanityUrl;
27

28
  @JsonProperty("vanity_name")
29
  @Nullable
30
  protected String vanityName;
31

32
  @JsonDeserialize(using = FileSharedLinkAccessField.FileSharedLinkAccessFieldDeserializer.class)
33
  @JsonSerialize(using = FileSharedLinkAccessField.FileSharedLinkAccessFieldSerializer.class)
34
  protected EnumWrapper<FileSharedLinkAccessField> access;
35

36
  @JsonDeserialize(
37
      using =
38
          FileSharedLinkEffectiveAccessField.FileSharedLinkEffectiveAccessFieldDeserializer.class)
39
  @JsonSerialize(
40
      using = FileSharedLinkEffectiveAccessField.FileSharedLinkEffectiveAccessFieldSerializer.class)
41
  @JsonProperty("effective_access")
42
  protected final EnumWrapper<FileSharedLinkEffectiveAccessField> effectiveAccess;
43

44
  @JsonDeserialize(
45
      using =
46
          FileSharedLinkEffectivePermissionField.FileSharedLinkEffectivePermissionFieldDeserializer
47
              .class)
48
  @JsonSerialize(
49
      using =
50
          FileSharedLinkEffectivePermissionField.FileSharedLinkEffectivePermissionFieldSerializer
51
              .class)
52
  @JsonProperty("effective_permission")
53
  protected final EnumWrapper<FileSharedLinkEffectivePermissionField> effectivePermission;
54

55
  @JsonProperty("unshared_at")
56
  @JsonSerialize(using = DateTimeUtils.DateTimeSerializer.class)
57
  @JsonDeserialize(using = DateTimeUtils.DateTimeDeserializer.class)
58
  @Nullable
59
  protected Date unsharedAt;
60

61
  @JsonProperty("is_password_enabled")
62
  protected final boolean isPasswordEnabled;
63

64
  protected FileSharedLinkPermissionsField permissions;
65

66
  @JsonProperty("download_count")
67
  protected final long downloadCount;
68

69
  @JsonProperty("preview_count")
70
  protected final long previewCount;
71

72
  public FileSharedLinkField(
73
      String url,
74
      FileSharedLinkEffectiveAccessField effectiveAccess,
75
      FileSharedLinkEffectivePermissionField effectivePermission,
76
      boolean isPasswordEnabled,
77
      long downloadCount,
78
      long previewCount) {
UNCOV
79
    super();
×
UNCOV
80
    this.url = url;
×
NEW
81
    this.effectiveAccess = new EnumWrapper<FileSharedLinkEffectiveAccessField>(effectiveAccess);
×
NEW
82
    this.effectivePermission =
×
83
        new EnumWrapper<FileSharedLinkEffectivePermissionField>(effectivePermission);
UNCOV
84
    this.isPasswordEnabled = isPasswordEnabled;
×
UNCOV
85
    this.downloadCount = downloadCount;
×
UNCOV
86
    this.previewCount = previewCount;
×
UNCOV
87
  }
×
88

89
  public FileSharedLinkField(
90
      String url,
91
      FileSharedLinkEffectiveAccessField effectiveAccess,
92
      EnumWrapper<FileSharedLinkEffectivePermissionField> effectivePermission,
93
      boolean isPasswordEnabled,
94
      long downloadCount,
95
      long previewCount) {
96
    super();
×
97
    this.url = url;
×
98
    this.effectiveAccess = new EnumWrapper<FileSharedLinkEffectiveAccessField>(effectiveAccess);
×
NEW
99
    this.effectivePermission = effectivePermission;
×
NEW
100
    this.isPasswordEnabled = isPasswordEnabled;
×
NEW
101
    this.downloadCount = downloadCount;
×
NEW
102
    this.previewCount = previewCount;
×
NEW
103
  }
×
104

105
  public FileSharedLinkField(
106
      String url,
107
      EnumWrapper<FileSharedLinkEffectiveAccessField> effectiveAccess,
108
      FileSharedLinkEffectivePermissionField effectivePermission,
109
      boolean isPasswordEnabled,
110
      long downloadCount,
111
      long previewCount) {
NEW
112
    super();
×
NEW
113
    this.url = url;
×
NEW
114
    this.effectiveAccess = effectiveAccess;
×
UNCOV
115
    this.effectivePermission =
×
116
        new EnumWrapper<FileSharedLinkEffectivePermissionField>(effectivePermission);
117
    this.isPasswordEnabled = isPasswordEnabled;
×
118
    this.downloadCount = downloadCount;
×
119
    this.previewCount = previewCount;
×
120
  }
×
121

122
  public FileSharedLinkField(
123
      @JsonProperty("url") String url,
124
      @JsonProperty("effective_access")
125
          EnumWrapper<FileSharedLinkEffectiveAccessField> effectiveAccess,
126
      @JsonProperty("effective_permission")
127
          EnumWrapper<FileSharedLinkEffectivePermissionField> effectivePermission,
128
      @JsonProperty("is_password_enabled") boolean isPasswordEnabled,
129
      @JsonProperty("download_count") long downloadCount,
130
      @JsonProperty("preview_count") long previewCount) {
131
    super();
1✔
132
    this.url = url;
1✔
133
    this.effectiveAccess = effectiveAccess;
1✔
134
    this.effectivePermission = effectivePermission;
1✔
135
    this.isPasswordEnabled = isPasswordEnabled;
1✔
136
    this.downloadCount = downloadCount;
1✔
137
    this.previewCount = previewCount;
1✔
138
  }
1✔
139

140
  protected FileSharedLinkField(Builder builder) {
141
    super();
×
142
    this.url = builder.url;
×
143
    this.downloadUrl = builder.downloadUrl;
×
144
    this.vanityUrl = builder.vanityUrl;
×
145
    this.vanityName = builder.vanityName;
×
146
    this.access = builder.access;
×
147
    this.effectiveAccess = builder.effectiveAccess;
×
148
    this.effectivePermission = builder.effectivePermission;
×
149
    this.unsharedAt = builder.unsharedAt;
×
150
    this.isPasswordEnabled = builder.isPasswordEnabled;
×
151
    this.permissions = builder.permissions;
×
152
    this.downloadCount = builder.downloadCount;
×
153
    this.previewCount = builder.previewCount;
×
154
    markNullableFieldsAsSet(builder.getExplicitlySetNullableFields());
×
155
  }
×
156

157
  public String getUrl() {
158
    return url;
1✔
159
  }
160

161
  public String getDownloadUrl() {
162
    return downloadUrl;
×
163
  }
164

165
  public String getVanityUrl() {
166
    return vanityUrl;
×
167
  }
168

169
  public String getVanityName() {
170
    return vanityName;
×
171
  }
172

173
  public EnumWrapper<FileSharedLinkAccessField> getAccess() {
174
    return access;
1✔
175
  }
176

177
  public EnumWrapper<FileSharedLinkEffectiveAccessField> getEffectiveAccess() {
178
    return effectiveAccess;
×
179
  }
180

181
  public EnumWrapper<FileSharedLinkEffectivePermissionField> getEffectivePermission() {
182
    return effectivePermission;
×
183
  }
184

185
  public Date getUnsharedAt() {
186
    return unsharedAt;
×
187
  }
188

189
  public boolean getIsPasswordEnabled() {
190
    return isPasswordEnabled;
×
191
  }
192

193
  public FileSharedLinkPermissionsField getPermissions() {
194
    return permissions;
×
195
  }
196

197
  public long getDownloadCount() {
198
    return downloadCount;
×
199
  }
200

201
  public long getPreviewCount() {
202
    return previewCount;
×
203
  }
204

205
  @Override
206
  public boolean equals(Object o) {
207
    if (this == o) {
×
208
      return true;
×
209
    }
210
    if (o == null || getClass() != o.getClass()) {
×
211
      return false;
×
212
    }
213
    FileSharedLinkField casted = (FileSharedLinkField) o;
×
214
    return Objects.equals(url, casted.url)
×
215
        && Objects.equals(downloadUrl, casted.downloadUrl)
×
216
        && Objects.equals(vanityUrl, casted.vanityUrl)
×
217
        && Objects.equals(vanityName, casted.vanityName)
×
218
        && Objects.equals(access, casted.access)
×
219
        && Objects.equals(effectiveAccess, casted.effectiveAccess)
×
220
        && Objects.equals(effectivePermission, casted.effectivePermission)
×
221
        && Objects.equals(unsharedAt, casted.unsharedAt)
×
222
        && Objects.equals(isPasswordEnabled, casted.isPasswordEnabled)
×
223
        && Objects.equals(permissions, casted.permissions)
×
224
        && Objects.equals(downloadCount, casted.downloadCount)
×
225
        && Objects.equals(previewCount, casted.previewCount);
×
226
  }
227

228
  @Override
229
  public int hashCode() {
230
    return Objects.hash(
×
231
        url,
232
        downloadUrl,
233
        vanityUrl,
234
        vanityName,
235
        access,
236
        effectiveAccess,
237
        effectivePermission,
238
        unsharedAt,
239
        isPasswordEnabled,
×
240
        permissions,
241
        downloadCount,
×
242
        previewCount);
×
243
  }
244

245
  @Override
246
  public String toString() {
247
    return "FileSharedLinkField{"
×
248
        + "url='"
249
        + url
250
        + '\''
251
        + ", "
252
        + "downloadUrl='"
253
        + downloadUrl
254
        + '\''
255
        + ", "
256
        + "vanityUrl='"
257
        + vanityUrl
258
        + '\''
259
        + ", "
260
        + "vanityName='"
261
        + vanityName
262
        + '\''
263
        + ", "
264
        + "access='"
265
        + access
266
        + '\''
267
        + ", "
268
        + "effectiveAccess='"
269
        + effectiveAccess
270
        + '\''
271
        + ", "
272
        + "effectivePermission='"
273
        + effectivePermission
274
        + '\''
275
        + ", "
276
        + "unsharedAt='"
277
        + unsharedAt
278
        + '\''
279
        + ", "
280
        + "isPasswordEnabled='"
281
        + isPasswordEnabled
282
        + '\''
283
        + ", "
284
        + "permissions='"
285
        + permissions
286
        + '\''
287
        + ", "
288
        + "downloadCount='"
289
        + downloadCount
290
        + '\''
291
        + ", "
292
        + "previewCount='"
293
        + previewCount
294
        + '\''
295
        + "}";
296
  }
297

298
  public static class Builder extends NullableFieldTracker {
299

300
    protected final String url;
301

302
    protected String downloadUrl;
303

304
    protected String vanityUrl;
305

306
    protected String vanityName;
307

308
    protected EnumWrapper<FileSharedLinkAccessField> access;
309

310
    protected final EnumWrapper<FileSharedLinkEffectiveAccessField> effectiveAccess;
311

312
    protected final EnumWrapper<FileSharedLinkEffectivePermissionField> effectivePermission;
313

314
    protected Date unsharedAt;
315

316
    protected final boolean isPasswordEnabled;
317

318
    protected FileSharedLinkPermissionsField permissions;
319

320
    protected final long downloadCount;
321

322
    protected final long previewCount;
323

324
    public Builder(
325
        String url,
326
        FileSharedLinkEffectiveAccessField effectiveAccess,
327
        FileSharedLinkEffectivePermissionField effectivePermission,
328
        boolean isPasswordEnabled,
329
        long downloadCount,
330
        long previewCount) {
NEW
331
      super();
×
NEW
332
      this.url = url;
×
NEW
333
      this.effectiveAccess = new EnumWrapper<FileSharedLinkEffectiveAccessField>(effectiveAccess);
×
NEW
334
      this.effectivePermission =
×
335
          new EnumWrapper<FileSharedLinkEffectivePermissionField>(effectivePermission);
NEW
336
      this.isPasswordEnabled = isPasswordEnabled;
×
NEW
337
      this.downloadCount = downloadCount;
×
NEW
338
      this.previewCount = previewCount;
×
NEW
339
    }
×
340

341
    public Builder(
342
        String url,
343
        FileSharedLinkEffectiveAccessField effectiveAccess,
344
        EnumWrapper<FileSharedLinkEffectivePermissionField> effectivePermission,
345
        boolean isPasswordEnabled,
346
        long downloadCount,
347
        long previewCount) {
348
      super();
×
349
      this.url = url;
×
NEW
350
      this.effectiveAccess = new EnumWrapper<FileSharedLinkEffectiveAccessField>(effectiveAccess);
×
351
      this.effectivePermission = effectivePermission;
×
352
      this.isPasswordEnabled = isPasswordEnabled;
×
353
      this.downloadCount = downloadCount;
×
354
      this.previewCount = previewCount;
×
355
    }
×
356

357
    public Builder(
358
        String url,
359
        EnumWrapper<FileSharedLinkEffectiveAccessField> effectiveAccess,
360
        FileSharedLinkEffectivePermissionField effectivePermission,
361
        boolean isPasswordEnabled,
362
        long downloadCount,
363
        long previewCount) {
364
      super();
×
365
      this.url = url;
×
NEW
366
      this.effectiveAccess = effectiveAccess;
×
367
      this.effectivePermission =
×
368
          new EnumWrapper<FileSharedLinkEffectivePermissionField>(effectivePermission);
369
      this.isPasswordEnabled = isPasswordEnabled;
×
370
      this.downloadCount = downloadCount;
×
371
      this.previewCount = previewCount;
×
372
    }
×
373

374
    public Builder(
375
        String url,
376
        EnumWrapper<FileSharedLinkEffectiveAccessField> effectiveAccess,
377
        EnumWrapper<FileSharedLinkEffectivePermissionField> effectivePermission,
378
        boolean isPasswordEnabled,
379
        long downloadCount,
380
        long previewCount) {
NEW
381
      super();
×
NEW
382
      this.url = url;
×
NEW
383
      this.effectiveAccess = effectiveAccess;
×
NEW
384
      this.effectivePermission = effectivePermission;
×
NEW
385
      this.isPasswordEnabled = isPasswordEnabled;
×
NEW
386
      this.downloadCount = downloadCount;
×
NEW
387
      this.previewCount = previewCount;
×
NEW
388
    }
×
389

390
    public Builder downloadUrl(String downloadUrl) {
391
      this.downloadUrl = downloadUrl;
×
392
      this.markNullableFieldAsSet("download_url");
×
393
      return this;
×
394
    }
395

396
    public Builder vanityUrl(String vanityUrl) {
397
      this.vanityUrl = vanityUrl;
×
398
      this.markNullableFieldAsSet("vanity_url");
×
399
      return this;
×
400
    }
401

402
    public Builder vanityName(String vanityName) {
403
      this.vanityName = vanityName;
×
404
      this.markNullableFieldAsSet("vanity_name");
×
405
      return this;
×
406
    }
407

408
    public Builder access(FileSharedLinkAccessField access) {
409
      this.access = new EnumWrapper<FileSharedLinkAccessField>(access);
×
410
      return this;
×
411
    }
412

413
    public Builder access(EnumWrapper<FileSharedLinkAccessField> access) {
414
      this.access = access;
×
415
      return this;
×
416
    }
417

418
    public Builder unsharedAt(Date unsharedAt) {
419
      this.unsharedAt = unsharedAt;
×
420
      this.markNullableFieldAsSet("unshared_at");
×
421
      return this;
×
422
    }
423

424
    public Builder permissions(FileSharedLinkPermissionsField permissions) {
425
      this.permissions = permissions;
×
426
      return this;
×
427
    }
428

429
    public FileSharedLinkField build() {
430
      return new FileSharedLinkField(this);
×
431
    }
432
  }
433
}
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