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

box / box-java-sdk-gen / #226

20 Jun 2025 03:14PM UTC coverage: 35.609% (-0.2%) from 35.816%
#226

push

github

web-flow
feat: Shorten builder names in Java (box/box-codegen#742) (#334)

367 of 1570 new or added lines in 984 files covered. (23.38%)

674 existing lines in 370 files now uncovered.

16125 of 45284 relevant lines covered (35.61%)

0.36 hits per line

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

10.53
/src/main/java/com/box/sdkgen/schemas/weblink/WebLinkSharedLinkField.java
1
package com.box.sdkgen.schemas.weblink;
2

3
import com.box.sdkgen.internal.SerializableObject;
4
import com.box.sdkgen.internal.utils.DateTimeUtils;
5
import com.box.sdkgen.serialization.json.EnumWrapper;
6
import com.fasterxml.jackson.annotation.JsonProperty;
7
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
8
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
9
import java.util.Date;
10
import java.util.Objects;
11

12
public class WebLinkSharedLinkField extends SerializableObject {
13

14
  protected final String url;
15

16
  @JsonProperty("download_url")
17
  protected String downloadUrl;
18

19
  @JsonProperty("vanity_url")
20
  protected String vanityUrl;
21

22
  @JsonProperty("vanity_name")
23
  protected String vanityName;
24

25
  @JsonDeserialize(
26
      using = WebLinkSharedLinkAccessField.WebLinkSharedLinkAccessFieldDeserializer.class)
27
  @JsonSerialize(using = WebLinkSharedLinkAccessField.WebLinkSharedLinkAccessFieldSerializer.class)
28
  protected EnumWrapper<WebLinkSharedLinkAccessField> access;
29

30
  @JsonDeserialize(
31
      using =
32
          WebLinkSharedLinkEffectiveAccessField.WebLinkSharedLinkEffectiveAccessFieldDeserializer
33
              .class)
34
  @JsonSerialize(
35
      using =
36
          WebLinkSharedLinkEffectiveAccessField.WebLinkSharedLinkEffectiveAccessFieldSerializer
37
              .class)
38
  @JsonProperty("effective_access")
39
  protected final EnumWrapper<WebLinkSharedLinkEffectiveAccessField> effectiveAccess;
40

41
  @JsonDeserialize(
42
      using =
43
          WebLinkSharedLinkEffectivePermissionField
44
              .WebLinkSharedLinkEffectivePermissionFieldDeserializer.class)
45
  @JsonSerialize(
46
      using =
47
          WebLinkSharedLinkEffectivePermissionField
48
              .WebLinkSharedLinkEffectivePermissionFieldSerializer.class)
49
  @JsonProperty("effective_permission")
50
  protected final EnumWrapper<WebLinkSharedLinkEffectivePermissionField> effectivePermission;
51

52
  @JsonProperty("unshared_at")
53
  @JsonSerialize(using = DateTimeUtils.DateTimeSerializer.class)
54
  @JsonDeserialize(using = DateTimeUtils.DateTimeDeserializer.class)
55
  protected Date unsharedAt;
56

57
  @JsonProperty("is_password_enabled")
58
  protected final boolean isPasswordEnabled;
59

60
  protected WebLinkSharedLinkPermissionsField permissions;
61

62
  @JsonProperty("download_count")
63
  protected final long downloadCount;
64

65
  @JsonProperty("preview_count")
66
  protected final long previewCount;
67

68
  public WebLinkSharedLinkField(
69
      @JsonProperty("url") String url,
70
      @JsonProperty("effective_access")
71
          EnumWrapper<WebLinkSharedLinkEffectiveAccessField> effectiveAccess,
72
      @JsonProperty("effective_permission")
73
          EnumWrapper<WebLinkSharedLinkEffectivePermissionField> effectivePermission,
74
      @JsonProperty("is_password_enabled") boolean isPasswordEnabled,
75
      @JsonProperty("download_count") long downloadCount,
76
      @JsonProperty("preview_count") long previewCount) {
77
    super();
1✔
78
    this.url = url;
1✔
79
    this.effectiveAccess = effectiveAccess;
1✔
80
    this.effectivePermission = effectivePermission;
1✔
81
    this.isPasswordEnabled = isPasswordEnabled;
1✔
82
    this.downloadCount = downloadCount;
1✔
83
    this.previewCount = previewCount;
1✔
84
  }
1✔
85

86
  public WebLinkSharedLinkField(
87
      String url,
88
      WebLinkSharedLinkEffectiveAccessField effectiveAccess,
89
      WebLinkSharedLinkEffectivePermissionField effectivePermission,
90
      boolean isPasswordEnabled,
91
      long downloadCount,
92
      long previewCount) {
93
    super();
×
94
    this.url = url;
×
95
    this.effectiveAccess = new EnumWrapper<WebLinkSharedLinkEffectiveAccessField>(effectiveAccess);
×
96
    this.effectivePermission =
×
97
        new EnumWrapper<WebLinkSharedLinkEffectivePermissionField>(effectivePermission);
98
    this.isPasswordEnabled = isPasswordEnabled;
×
99
    this.downloadCount = downloadCount;
×
100
    this.previewCount = previewCount;
×
101
  }
×
102

103
  protected WebLinkSharedLinkField(Builder builder) {
104
    super();
×
105
    this.url = builder.url;
×
106
    this.downloadUrl = builder.downloadUrl;
×
107
    this.vanityUrl = builder.vanityUrl;
×
108
    this.vanityName = builder.vanityName;
×
109
    this.access = builder.access;
×
110
    this.effectiveAccess = builder.effectiveAccess;
×
111
    this.effectivePermission = builder.effectivePermission;
×
112
    this.unsharedAt = builder.unsharedAt;
×
113
    this.isPasswordEnabled = builder.isPasswordEnabled;
×
114
    this.permissions = builder.permissions;
×
115
    this.downloadCount = builder.downloadCount;
×
116
    this.previewCount = builder.previewCount;
×
117
  }
×
118

119
  public String getUrl() {
120
    return url;
1✔
121
  }
122

123
  public String getDownloadUrl() {
124
    return downloadUrl;
×
125
  }
126

127
  public String getVanityUrl() {
128
    return vanityUrl;
×
129
  }
130

131
  public String getVanityName() {
132
    return vanityName;
×
133
  }
134

135
  public EnumWrapper<WebLinkSharedLinkAccessField> getAccess() {
136
    return access;
1✔
137
  }
138

139
  public EnumWrapper<WebLinkSharedLinkEffectiveAccessField> getEffectiveAccess() {
140
    return effectiveAccess;
×
141
  }
142

143
  public EnumWrapper<WebLinkSharedLinkEffectivePermissionField> getEffectivePermission() {
144
    return effectivePermission;
×
145
  }
146

147
  public Date getUnsharedAt() {
148
    return unsharedAt;
×
149
  }
150

151
  public boolean getIsPasswordEnabled() {
152
    return isPasswordEnabled;
×
153
  }
154

155
  public WebLinkSharedLinkPermissionsField getPermissions() {
156
    return permissions;
×
157
  }
158

159
  public long getDownloadCount() {
160
    return downloadCount;
×
161
  }
162

163
  public long getPreviewCount() {
164
    return previewCount;
×
165
  }
166

167
  @Override
168
  public boolean equals(Object o) {
169
    if (this == o) {
×
170
      return true;
×
171
    }
172
    if (o == null || getClass() != o.getClass()) {
×
173
      return false;
×
174
    }
175
    WebLinkSharedLinkField casted = (WebLinkSharedLinkField) o;
×
176
    return Objects.equals(url, casted.url)
×
177
        && Objects.equals(downloadUrl, casted.downloadUrl)
×
178
        && Objects.equals(vanityUrl, casted.vanityUrl)
×
179
        && Objects.equals(vanityName, casted.vanityName)
×
180
        && Objects.equals(access, casted.access)
×
181
        && Objects.equals(effectiveAccess, casted.effectiveAccess)
×
182
        && Objects.equals(effectivePermission, casted.effectivePermission)
×
183
        && Objects.equals(unsharedAt, casted.unsharedAt)
×
184
        && Objects.equals(isPasswordEnabled, casted.isPasswordEnabled)
×
185
        && Objects.equals(permissions, casted.permissions)
×
186
        && Objects.equals(downloadCount, casted.downloadCount)
×
187
        && Objects.equals(previewCount, casted.previewCount);
×
188
  }
189

190
  @Override
191
  public int hashCode() {
192
    return Objects.hash(
×
193
        url,
194
        downloadUrl,
195
        vanityUrl,
196
        vanityName,
197
        access,
198
        effectiveAccess,
199
        effectivePermission,
200
        unsharedAt,
201
        isPasswordEnabled,
×
202
        permissions,
203
        downloadCount,
×
204
        previewCount);
×
205
  }
206

207
  @Override
208
  public String toString() {
209
    return "WebLinkSharedLinkField{"
×
210
        + "url='"
211
        + url
212
        + '\''
213
        + ", "
214
        + "downloadUrl='"
215
        + downloadUrl
216
        + '\''
217
        + ", "
218
        + "vanityUrl='"
219
        + vanityUrl
220
        + '\''
221
        + ", "
222
        + "vanityName='"
223
        + vanityName
224
        + '\''
225
        + ", "
226
        + "access='"
227
        + access
228
        + '\''
229
        + ", "
230
        + "effectiveAccess='"
231
        + effectiveAccess
232
        + '\''
233
        + ", "
234
        + "effectivePermission='"
235
        + effectivePermission
236
        + '\''
237
        + ", "
238
        + "unsharedAt='"
239
        + unsharedAt
240
        + '\''
241
        + ", "
242
        + "isPasswordEnabled='"
243
        + isPasswordEnabled
244
        + '\''
245
        + ", "
246
        + "permissions='"
247
        + permissions
248
        + '\''
249
        + ", "
250
        + "downloadCount='"
251
        + downloadCount
252
        + '\''
253
        + ", "
254
        + "previewCount='"
255
        + previewCount
256
        + '\''
257
        + "}";
258
  }
259

260
  public static class Builder {
261

262
    protected final String url;
263

264
    protected String downloadUrl;
265

266
    protected String vanityUrl;
267

268
    protected String vanityName;
269

270
    protected EnumWrapper<WebLinkSharedLinkAccessField> access;
271

272
    protected final EnumWrapper<WebLinkSharedLinkEffectiveAccessField> effectiveAccess;
273

274
    protected final EnumWrapper<WebLinkSharedLinkEffectivePermissionField> effectivePermission;
275

276
    protected Date unsharedAt;
277

278
    protected final boolean isPasswordEnabled;
279

280
    protected WebLinkSharedLinkPermissionsField permissions;
281

282
    protected final long downloadCount;
283

284
    protected final long previewCount;
285

286
    public Builder(
287
        String url,
288
        EnumWrapper<WebLinkSharedLinkEffectiveAccessField> effectiveAccess,
289
        EnumWrapper<WebLinkSharedLinkEffectivePermissionField> effectivePermission,
290
        boolean isPasswordEnabled,
291
        long downloadCount,
292
        long previewCount) {
×
293
      this.url = url;
×
294
      this.effectiveAccess = effectiveAccess;
×
295
      this.effectivePermission = effectivePermission;
×
296
      this.isPasswordEnabled = isPasswordEnabled;
×
297
      this.downloadCount = downloadCount;
×
298
      this.previewCount = previewCount;
×
299
    }
×
300

301
    public Builder(
302
        String url,
303
        WebLinkSharedLinkEffectiveAccessField effectiveAccess,
304
        WebLinkSharedLinkEffectivePermissionField effectivePermission,
305
        boolean isPasswordEnabled,
306
        long downloadCount,
307
        long previewCount) {
×
308
      this.url = url;
×
309
      this.effectiveAccess =
×
310
          new EnumWrapper<WebLinkSharedLinkEffectiveAccessField>(effectiveAccess);
311
      this.effectivePermission =
×
312
          new EnumWrapper<WebLinkSharedLinkEffectivePermissionField>(effectivePermission);
313
      this.isPasswordEnabled = isPasswordEnabled;
×
314
      this.downloadCount = downloadCount;
×
315
      this.previewCount = previewCount;
×
316
    }
×
317

318
    public Builder downloadUrl(String downloadUrl) {
319
      this.downloadUrl = downloadUrl;
×
320
      return this;
×
321
    }
322

323
    public Builder vanityUrl(String vanityUrl) {
324
      this.vanityUrl = vanityUrl;
×
325
      return this;
×
326
    }
327

328
    public Builder vanityName(String vanityName) {
329
      this.vanityName = vanityName;
×
330
      return this;
×
331
    }
332

333
    public Builder access(WebLinkSharedLinkAccessField access) {
334
      this.access = new EnumWrapper<WebLinkSharedLinkAccessField>(access);
×
335
      return this;
×
336
    }
337

338
    public Builder access(EnumWrapper<WebLinkSharedLinkAccessField> access) {
339
      this.access = access;
×
340
      return this;
×
341
    }
342

343
    public Builder unsharedAt(Date unsharedAt) {
344
      this.unsharedAt = unsharedAt;
×
345
      return this;
×
346
    }
347

348
    public Builder permissions(WebLinkSharedLinkPermissionsField permissions) {
UNCOV
349
      this.permissions = permissions;
×
350
      return this;
×
351
    }
352

353
    public WebLinkSharedLinkField build() {
354
      return new WebLinkSharedLinkField(this);
×
355
    }
356
  }
357
}
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