• 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/weblink/WebLinkSharedLinkField.java
1
package com.box.sdkgen.schemas.weblink;
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 WebLinkSharedLinkField 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(
33
      using = WebLinkSharedLinkAccessField.WebLinkSharedLinkAccessFieldDeserializer.class)
34
  @JsonSerialize(using = WebLinkSharedLinkAccessField.WebLinkSharedLinkAccessFieldSerializer.class)
35
  protected EnumWrapper<WebLinkSharedLinkAccessField> access;
36

37
  @JsonDeserialize(
38
      using =
39
          WebLinkSharedLinkEffectiveAccessField.WebLinkSharedLinkEffectiveAccessFieldDeserializer
40
              .class)
41
  @JsonSerialize(
42
      using =
43
          WebLinkSharedLinkEffectiveAccessField.WebLinkSharedLinkEffectiveAccessFieldSerializer
44
              .class)
45
  @JsonProperty("effective_access")
46
  protected final EnumWrapper<WebLinkSharedLinkEffectiveAccessField> effectiveAccess;
47

48
  @JsonDeserialize(
49
      using =
50
          WebLinkSharedLinkEffectivePermissionField
51
              .WebLinkSharedLinkEffectivePermissionFieldDeserializer.class)
52
  @JsonSerialize(
53
      using =
54
          WebLinkSharedLinkEffectivePermissionField
55
              .WebLinkSharedLinkEffectivePermissionFieldSerializer.class)
56
  @JsonProperty("effective_permission")
57
  protected final EnumWrapper<WebLinkSharedLinkEffectivePermissionField> effectivePermission;
58

59
  @JsonProperty("unshared_at")
60
  @JsonSerialize(using = DateTimeUtils.DateTimeSerializer.class)
61
  @JsonDeserialize(using = DateTimeUtils.DateTimeDeserializer.class)
62
  @Nullable
63
  protected Date unsharedAt;
64

65
  @JsonProperty("is_password_enabled")
66
  protected final boolean isPasswordEnabled;
67

68
  protected WebLinkSharedLinkPermissionsField permissions;
69

70
  @JsonProperty("download_count")
71
  protected final long downloadCount;
72

73
  @JsonProperty("preview_count")
74
  protected final long previewCount;
75

76
  public WebLinkSharedLinkField(
77
      String url,
78
      WebLinkSharedLinkEffectiveAccessField effectiveAccess,
79
      WebLinkSharedLinkEffectivePermissionField effectivePermission,
80
      boolean isPasswordEnabled,
81
      long downloadCount,
82
      long previewCount) {
UNCOV
83
    super();
×
UNCOV
84
    this.url = url;
×
NEW
85
    this.effectiveAccess = new EnumWrapper<WebLinkSharedLinkEffectiveAccessField>(effectiveAccess);
×
NEW
86
    this.effectivePermission =
×
87
        new EnumWrapper<WebLinkSharedLinkEffectivePermissionField>(effectivePermission);
UNCOV
88
    this.isPasswordEnabled = isPasswordEnabled;
×
UNCOV
89
    this.downloadCount = downloadCount;
×
UNCOV
90
    this.previewCount = previewCount;
×
UNCOV
91
  }
×
92

93
  public WebLinkSharedLinkField(
94
      String url,
95
      WebLinkSharedLinkEffectiveAccessField effectiveAccess,
96
      EnumWrapper<WebLinkSharedLinkEffectivePermissionField> effectivePermission,
97
      boolean isPasswordEnabled,
98
      long downloadCount,
99
      long previewCount) {
100
    super();
×
101
    this.url = url;
×
102
    this.effectiveAccess = new EnumWrapper<WebLinkSharedLinkEffectiveAccessField>(effectiveAccess);
×
NEW
103
    this.effectivePermission = effectivePermission;
×
NEW
104
    this.isPasswordEnabled = isPasswordEnabled;
×
NEW
105
    this.downloadCount = downloadCount;
×
NEW
106
    this.previewCount = previewCount;
×
NEW
107
  }
×
108

109
  public WebLinkSharedLinkField(
110
      String url,
111
      EnumWrapper<WebLinkSharedLinkEffectiveAccessField> effectiveAccess,
112
      WebLinkSharedLinkEffectivePermissionField effectivePermission,
113
      boolean isPasswordEnabled,
114
      long downloadCount,
115
      long previewCount) {
NEW
116
    super();
×
NEW
117
    this.url = url;
×
NEW
118
    this.effectiveAccess = effectiveAccess;
×
UNCOV
119
    this.effectivePermission =
×
120
        new EnumWrapper<WebLinkSharedLinkEffectivePermissionField>(effectivePermission);
121
    this.isPasswordEnabled = isPasswordEnabled;
×
122
    this.downloadCount = downloadCount;
×
123
    this.previewCount = previewCount;
×
124
  }
×
125

126
  public WebLinkSharedLinkField(
127
      @JsonProperty("url") String url,
128
      @JsonProperty("effective_access")
129
          EnumWrapper<WebLinkSharedLinkEffectiveAccessField> effectiveAccess,
130
      @JsonProperty("effective_permission")
131
          EnumWrapper<WebLinkSharedLinkEffectivePermissionField> effectivePermission,
132
      @JsonProperty("is_password_enabled") boolean isPasswordEnabled,
133
      @JsonProperty("download_count") long downloadCount,
134
      @JsonProperty("preview_count") long previewCount) {
135
    super();
1✔
136
    this.url = url;
1✔
137
    this.effectiveAccess = effectiveAccess;
1✔
138
    this.effectivePermission = effectivePermission;
1✔
139
    this.isPasswordEnabled = isPasswordEnabled;
1✔
140
    this.downloadCount = downloadCount;
1✔
141
    this.previewCount = previewCount;
1✔
142
  }
1✔
143

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

161
  public String getUrl() {
162
    return url;
1✔
163
  }
164

165
  public String getDownloadUrl() {
166
    return downloadUrl;
×
167
  }
168

169
  public String getVanityUrl() {
170
    return vanityUrl;
×
171
  }
172

173
  public String getVanityName() {
174
    return vanityName;
×
175
  }
176

177
  public EnumWrapper<WebLinkSharedLinkAccessField> getAccess() {
178
    return access;
1✔
179
  }
180

181
  public EnumWrapper<WebLinkSharedLinkEffectiveAccessField> getEffectiveAccess() {
182
    return effectiveAccess;
×
183
  }
184

185
  public EnumWrapper<WebLinkSharedLinkEffectivePermissionField> getEffectivePermission() {
186
    return effectivePermission;
×
187
  }
188

189
  public Date getUnsharedAt() {
190
    return unsharedAt;
×
191
  }
192

193
  public boolean getIsPasswordEnabled() {
194
    return isPasswordEnabled;
×
195
  }
196

197
  public WebLinkSharedLinkPermissionsField getPermissions() {
198
    return permissions;
×
199
  }
200

201
  public long getDownloadCount() {
202
    return downloadCount;
×
203
  }
204

205
  public long getPreviewCount() {
206
    return previewCount;
×
207
  }
208

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

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

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

302
  public static class Builder extends NullableFieldTracker {
303

304
    protected final String url;
305

306
    protected String downloadUrl;
307

308
    protected String vanityUrl;
309

310
    protected String vanityName;
311

312
    protected EnumWrapper<WebLinkSharedLinkAccessField> access;
313

314
    protected final EnumWrapper<WebLinkSharedLinkEffectiveAccessField> effectiveAccess;
315

316
    protected final EnumWrapper<WebLinkSharedLinkEffectivePermissionField> effectivePermission;
317

318
    protected Date unsharedAt;
319

320
    protected final boolean isPasswordEnabled;
321

322
    protected WebLinkSharedLinkPermissionsField permissions;
323

324
    protected final long downloadCount;
325

326
    protected final long previewCount;
327

328
    public Builder(
329
        String url,
330
        WebLinkSharedLinkEffectiveAccessField effectiveAccess,
331
        WebLinkSharedLinkEffectivePermissionField effectivePermission,
332
        boolean isPasswordEnabled,
333
        long downloadCount,
334
        long previewCount) {
335
      super();
×
336
      this.url = url;
×
NEW
337
      this.effectiveAccess =
×
338
          new EnumWrapper<WebLinkSharedLinkEffectiveAccessField>(effectiveAccess);
NEW
339
      this.effectivePermission =
×
340
          new EnumWrapper<WebLinkSharedLinkEffectivePermissionField>(effectivePermission);
341
      this.isPasswordEnabled = isPasswordEnabled;
×
342
      this.downloadCount = downloadCount;
×
343
      this.previewCount = previewCount;
×
344
    }
×
345

346
    public Builder(
347
        String url,
348
        WebLinkSharedLinkEffectiveAccessField effectiveAccess,
349
        EnumWrapper<WebLinkSharedLinkEffectivePermissionField> effectivePermission,
350
        boolean isPasswordEnabled,
351
        long downloadCount,
352
        long previewCount) {
353
      super();
×
354
      this.url = url;
×
355
      this.effectiveAccess =
×
356
          new EnumWrapper<WebLinkSharedLinkEffectiveAccessField>(effectiveAccess);
NEW
357
      this.effectivePermission = effectivePermission;
×
NEW
358
      this.isPasswordEnabled = isPasswordEnabled;
×
NEW
359
      this.downloadCount = downloadCount;
×
NEW
360
      this.previewCount = previewCount;
×
NEW
361
    }
×
362

363
    public Builder(
364
        String url,
365
        EnumWrapper<WebLinkSharedLinkEffectiveAccessField> effectiveAccess,
366
        WebLinkSharedLinkEffectivePermissionField effectivePermission,
367
        boolean isPasswordEnabled,
368
        long downloadCount,
369
        long previewCount) {
NEW
370
      super();
×
NEW
371
      this.url = url;
×
NEW
372
      this.effectiveAccess = effectiveAccess;
×
UNCOV
373
      this.effectivePermission =
×
374
          new EnumWrapper<WebLinkSharedLinkEffectivePermissionField>(effectivePermission);
375
      this.isPasswordEnabled = isPasswordEnabled;
×
376
      this.downloadCount = downloadCount;
×
377
      this.previewCount = previewCount;
×
378
    }
×
379

380
    public Builder(
381
        String url,
382
        EnumWrapper<WebLinkSharedLinkEffectiveAccessField> effectiveAccess,
383
        EnumWrapper<WebLinkSharedLinkEffectivePermissionField> effectivePermission,
384
        boolean isPasswordEnabled,
385
        long downloadCount,
386
        long previewCount) {
NEW
387
      super();
×
NEW
388
      this.url = url;
×
NEW
389
      this.effectiveAccess = effectiveAccess;
×
NEW
390
      this.effectivePermission = effectivePermission;
×
NEW
391
      this.isPasswordEnabled = isPasswordEnabled;
×
NEW
392
      this.downloadCount = downloadCount;
×
NEW
393
      this.previewCount = previewCount;
×
NEW
394
    }
×
395

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

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

408
    public Builder vanityName(String vanityName) {
409
      this.vanityName = vanityName;
×
410
      this.markNullableFieldAsSet("vanity_name");
×
411
      return this;
×
412
    }
413

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

419
    public Builder access(EnumWrapper<WebLinkSharedLinkAccessField> access) {
420
      this.access = access;
×
421
      return this;
×
422
    }
423

424
    public Builder unsharedAt(Date unsharedAt) {
425
      this.unsharedAt = unsharedAt;
×
426
      this.markNullableFieldAsSet("unshared_at");
×
427
      return this;
×
428
    }
429

430
    public Builder permissions(WebLinkSharedLinkPermissionsField permissions) {
431
      this.permissions = permissions;
×
432
      return this;
×
433
    }
434

435
    public WebLinkSharedLinkField build() {
436
      return new WebLinkSharedLinkField(this);
×
437
    }
438
  }
439
}
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