• 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

57.43
/src/main/java/com/box/sdkgen/schemas/postoauth2token/PostOAuth2Token.java
1
package com.box.sdkgen.schemas.postoauth2token;
2

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

10
public class PostOAuth2Token extends SerializableObject {
11

12
  @JsonDeserialize(
13
      using = PostOAuth2TokenGrantTypeField.PostOAuth2TokenGrantTypeFieldDeserializer.class)
14
  @JsonSerialize(
15
      using = PostOAuth2TokenGrantTypeField.PostOAuth2TokenGrantTypeFieldSerializer.class)
16
  @JsonProperty("grant_type")
17
  protected final EnumWrapper<PostOAuth2TokenGrantTypeField> grantType;
18

19
  @JsonProperty("client_id")
20
  protected String clientId;
21

22
  @JsonProperty("client_secret")
23
  protected String clientSecret;
24

25
  protected String code;
26

27
  @JsonProperty("refresh_token")
28
  protected String refreshToken;
29

30
  protected String assertion;
31

32
  @JsonProperty("subject_token")
33
  protected String subjectToken;
34

35
  @JsonDeserialize(
36
      using =
37
          PostOAuth2TokenSubjectTokenTypeField.PostOAuth2TokenSubjectTokenTypeFieldDeserializer
38
              .class)
39
  @JsonSerialize(
40
      using =
41
          PostOAuth2TokenSubjectTokenTypeField.PostOAuth2TokenSubjectTokenTypeFieldSerializer.class)
42
  @JsonProperty("subject_token_type")
43
  protected EnumWrapper<PostOAuth2TokenSubjectTokenTypeField> subjectTokenType;
44

45
  @JsonProperty("actor_token")
46
  protected String actorToken;
47

48
  @JsonDeserialize(
49
      using =
50
          PostOAuth2TokenActorTokenTypeField.PostOAuth2TokenActorTokenTypeFieldDeserializer.class)
51
  @JsonSerialize(
52
      using = PostOAuth2TokenActorTokenTypeField.PostOAuth2TokenActorTokenTypeFieldSerializer.class)
53
  @JsonProperty("actor_token_type")
54
  protected EnumWrapper<PostOAuth2TokenActorTokenTypeField> actorTokenType;
55

56
  protected String scope;
57

58
  protected String resource;
59

60
  @JsonDeserialize(
61
      using =
62
          PostOAuth2TokenBoxSubjectTypeField.PostOAuth2TokenBoxSubjectTypeFieldDeserializer.class)
63
  @JsonSerialize(
64
      using = PostOAuth2TokenBoxSubjectTypeField.PostOAuth2TokenBoxSubjectTypeFieldSerializer.class)
65
  @JsonProperty("box_subject_type")
66
  protected EnumWrapper<PostOAuth2TokenBoxSubjectTypeField> boxSubjectType;
67

68
  @JsonProperty("box_subject_id")
69
  protected String boxSubjectId;
70

71
  @JsonProperty("box_shared_link")
72
  protected String boxSharedLink;
73

74
  public PostOAuth2Token(
75
      @JsonProperty("grant_type") EnumWrapper<PostOAuth2TokenGrantTypeField> grantType) {
76
    super();
×
77
    this.grantType = grantType;
×
78
  }
×
79

80
  public PostOAuth2Token(PostOAuth2TokenGrantTypeField grantType) {
81
    super();
×
82
    this.grantType = new EnumWrapper<PostOAuth2TokenGrantTypeField>(grantType);
×
83
  }
×
84

85
  protected PostOAuth2Token(Builder builder) {
86
    super();
1✔
87
    this.grantType = builder.grantType;
1✔
88
    this.clientId = builder.clientId;
1✔
89
    this.clientSecret = builder.clientSecret;
1✔
90
    this.code = builder.code;
1✔
91
    this.refreshToken = builder.refreshToken;
1✔
92
    this.assertion = builder.assertion;
1✔
93
    this.subjectToken = builder.subjectToken;
1✔
94
    this.subjectTokenType = builder.subjectTokenType;
1✔
95
    this.actorToken = builder.actorToken;
1✔
96
    this.actorTokenType = builder.actorTokenType;
1✔
97
    this.scope = builder.scope;
1✔
98
    this.resource = builder.resource;
1✔
99
    this.boxSubjectType = builder.boxSubjectType;
1✔
100
    this.boxSubjectId = builder.boxSubjectId;
1✔
101
    this.boxSharedLink = builder.boxSharedLink;
1✔
102
  }
1✔
103

104
  public EnumWrapper<PostOAuth2TokenGrantTypeField> getGrantType() {
105
    return grantType;
1✔
106
  }
107

108
  public String getClientId() {
109
    return clientId;
1✔
110
  }
111

112
  public String getClientSecret() {
113
    return clientSecret;
1✔
114
  }
115

116
  public String getCode() {
117
    return code;
1✔
118
  }
119

120
  public String getRefreshToken() {
121
    return refreshToken;
1✔
122
  }
123

124
  public String getAssertion() {
125
    return assertion;
1✔
126
  }
127

128
  public String getSubjectToken() {
129
    return subjectToken;
1✔
130
  }
131

132
  public EnumWrapper<PostOAuth2TokenSubjectTokenTypeField> getSubjectTokenType() {
133
    return subjectTokenType;
1✔
134
  }
135

136
  public String getActorToken() {
137
    return actorToken;
1✔
138
  }
139

140
  public EnumWrapper<PostOAuth2TokenActorTokenTypeField> getActorTokenType() {
141
    return actorTokenType;
1✔
142
  }
143

144
  public String getScope() {
145
    return scope;
1✔
146
  }
147

148
  public String getResource() {
149
    return resource;
1✔
150
  }
151

152
  public EnumWrapper<PostOAuth2TokenBoxSubjectTypeField> getBoxSubjectType() {
153
    return boxSubjectType;
1✔
154
  }
155

156
  public String getBoxSubjectId() {
157
    return boxSubjectId;
1✔
158
  }
159

160
  public String getBoxSharedLink() {
161
    return boxSharedLink;
1✔
162
  }
163

164
  @Override
165
  public boolean equals(Object o) {
166
    if (this == o) {
×
167
      return true;
×
168
    }
169
    if (o == null || getClass() != o.getClass()) {
×
170
      return false;
×
171
    }
172
    PostOAuth2Token casted = (PostOAuth2Token) o;
×
173
    return Objects.equals(grantType, casted.grantType)
×
174
        && Objects.equals(clientId, casted.clientId)
×
175
        && Objects.equals(clientSecret, casted.clientSecret)
×
176
        && Objects.equals(code, casted.code)
×
177
        && Objects.equals(refreshToken, casted.refreshToken)
×
178
        && Objects.equals(assertion, casted.assertion)
×
179
        && Objects.equals(subjectToken, casted.subjectToken)
×
180
        && Objects.equals(subjectTokenType, casted.subjectTokenType)
×
181
        && Objects.equals(actorToken, casted.actorToken)
×
182
        && Objects.equals(actorTokenType, casted.actorTokenType)
×
183
        && Objects.equals(scope, casted.scope)
×
184
        && Objects.equals(resource, casted.resource)
×
185
        && Objects.equals(boxSubjectType, casted.boxSubjectType)
×
186
        && Objects.equals(boxSubjectId, casted.boxSubjectId)
×
187
        && Objects.equals(boxSharedLink, casted.boxSharedLink);
×
188
  }
189

190
  @Override
191
  public int hashCode() {
192
    return Objects.hash(
×
193
        grantType,
194
        clientId,
195
        clientSecret,
196
        code,
197
        refreshToken,
198
        assertion,
199
        subjectToken,
200
        subjectTokenType,
201
        actorToken,
202
        actorTokenType,
203
        scope,
204
        resource,
205
        boxSubjectType,
206
        boxSubjectId,
207
        boxSharedLink);
208
  }
209

210
  @Override
211
  public String toString() {
212
    return "PostOAuth2Token{"
×
213
        + "grantType='"
214
        + grantType
215
        + '\''
216
        + ", "
217
        + "clientId='"
218
        + clientId
219
        + '\''
220
        + ", "
221
        + "clientSecret='"
222
        + clientSecret
223
        + '\''
224
        + ", "
225
        + "code='"
226
        + code
227
        + '\''
228
        + ", "
229
        + "refreshToken='"
230
        + refreshToken
231
        + '\''
232
        + ", "
233
        + "assertion='"
234
        + assertion
235
        + '\''
236
        + ", "
237
        + "subjectToken='"
238
        + subjectToken
239
        + '\''
240
        + ", "
241
        + "subjectTokenType='"
242
        + subjectTokenType
243
        + '\''
244
        + ", "
245
        + "actorToken='"
246
        + actorToken
247
        + '\''
248
        + ", "
249
        + "actorTokenType='"
250
        + actorTokenType
251
        + '\''
252
        + ", "
253
        + "scope='"
254
        + scope
255
        + '\''
256
        + ", "
257
        + "resource='"
258
        + resource
259
        + '\''
260
        + ", "
261
        + "boxSubjectType='"
262
        + boxSubjectType
263
        + '\''
264
        + ", "
265
        + "boxSubjectId='"
266
        + boxSubjectId
267
        + '\''
268
        + ", "
269
        + "boxSharedLink='"
270
        + boxSharedLink
271
        + '\''
272
        + "}";
273
  }
274

275
  public static class Builder {
276

277
    protected final EnumWrapper<PostOAuth2TokenGrantTypeField> grantType;
278

279
    protected String clientId;
280

281
    protected String clientSecret;
282

283
    protected String code;
284

285
    protected String refreshToken;
286

287
    protected String assertion;
288

289
    protected String subjectToken;
290

291
    protected EnumWrapper<PostOAuth2TokenSubjectTokenTypeField> subjectTokenType;
292

293
    protected String actorToken;
294

295
    protected EnumWrapper<PostOAuth2TokenActorTokenTypeField> actorTokenType;
296

297
    protected String scope;
298

299
    protected String resource;
300

301
    protected EnumWrapper<PostOAuth2TokenBoxSubjectTypeField> boxSubjectType;
302

303
    protected String boxSubjectId;
304

305
    protected String boxSharedLink;
306

NEW
307
    public Builder(EnumWrapper<PostOAuth2TokenGrantTypeField> grantType) {
×
308
      this.grantType = grantType;
×
309
    }
×
310

311
    public Builder(PostOAuth2TokenGrantTypeField grantType) {
1✔
312
      this.grantType = new EnumWrapper<PostOAuth2TokenGrantTypeField>(grantType);
1✔
313
    }
1✔
314

315
    public Builder clientId(String clientId) {
316
      this.clientId = clientId;
1✔
317
      return this;
1✔
318
    }
319

320
    public Builder clientSecret(String clientSecret) {
321
      this.clientSecret = clientSecret;
1✔
322
      return this;
1✔
323
    }
324

325
    public Builder code(String code) {
326
      this.code = code;
×
327
      return this;
×
328
    }
329

330
    public Builder refreshToken(String refreshToken) {
331
      this.refreshToken = refreshToken;
1✔
332
      return this;
1✔
333
    }
334

335
    public Builder assertion(String assertion) {
336
      this.assertion = assertion;
1✔
337
      return this;
1✔
338
    }
339

340
    public Builder subjectToken(String subjectToken) {
341
      this.subjectToken = subjectToken;
1✔
342
      return this;
1✔
343
    }
344

345
    public Builder subjectTokenType(PostOAuth2TokenSubjectTokenTypeField subjectTokenType) {
346
      this.subjectTokenType =
1✔
347
          new EnumWrapper<PostOAuth2TokenSubjectTokenTypeField>(subjectTokenType);
348
      return this;
1✔
349
    }
350

351
    public Builder subjectTokenType(
352
        EnumWrapper<PostOAuth2TokenSubjectTokenTypeField> subjectTokenType) {
353
      this.subjectTokenType = subjectTokenType;
×
354
      return this;
×
355
    }
356

357
    public Builder actorToken(String actorToken) {
358
      this.actorToken = actorToken;
×
359
      return this;
×
360
    }
361

362
    public Builder actorTokenType(PostOAuth2TokenActorTokenTypeField actorTokenType) {
UNCOV
363
      this.actorTokenType = new EnumWrapper<PostOAuth2TokenActorTokenTypeField>(actorTokenType);
×
364
      return this;
×
365
    }
366

367
    public Builder actorTokenType(EnumWrapper<PostOAuth2TokenActorTokenTypeField> actorTokenType) {
UNCOV
368
      this.actorTokenType = actorTokenType;
×
369
      return this;
×
370
    }
371

372
    public Builder scope(String scope) {
373
      this.scope = scope;
1✔
374
      return this;
1✔
375
    }
376

377
    public Builder resource(String resource) {
378
      this.resource = resource;
1✔
379
      return this;
1✔
380
    }
381

382
    public Builder boxSubjectType(PostOAuth2TokenBoxSubjectTypeField boxSubjectType) {
UNCOV
383
      this.boxSubjectType = new EnumWrapper<PostOAuth2TokenBoxSubjectTypeField>(boxSubjectType);
×
384
      return this;
×
385
    }
386

387
    public Builder boxSubjectType(EnumWrapper<PostOAuth2TokenBoxSubjectTypeField> boxSubjectType) {
388
      this.boxSubjectType = boxSubjectType;
1✔
389
      return this;
1✔
390
    }
391

392
    public Builder boxSubjectId(String boxSubjectId) {
393
      this.boxSubjectId = boxSubjectId;
1✔
394
      return this;
1✔
395
    }
396

397
    public Builder boxSharedLink(String boxSharedLink) {
398
      this.boxSharedLink = boxSharedLink;
1✔
399
      return this;
1✔
400
    }
401

402
    public PostOAuth2Token build() {
403
      return new PostOAuth2Token(this);
1✔
404
    }
405
  }
406
}
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