• 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

5.43
/src/main/java/com/box/sdkgen/schemas/retentionpolicy/RetentionPolicy.java
1
package com.box.sdkgen.schemas.retentionpolicy;
2

3
import com.box.sdkgen.internal.utils.DateTimeUtils;
4
import com.box.sdkgen.schemas.retentionpolicybase.RetentionPolicyBaseTypeField;
5
import com.box.sdkgen.schemas.retentionpolicymini.RetentionPolicyMini;
6
import com.box.sdkgen.schemas.retentionpolicymini.RetentionPolicyMiniDispositionActionField;
7
import com.box.sdkgen.schemas.usermini.UserMini;
8
import com.box.sdkgen.serialization.json.EnumWrapper;
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.List;
14
import java.util.Objects;
15

16
public class RetentionPolicy extends RetentionPolicyMini {
17

18
  protected String description;
19

20
  @JsonDeserialize(
21
      using = RetentionPolicyPolicyTypeField.RetentionPolicyPolicyTypeFieldDeserializer.class)
22
  @JsonSerialize(
23
      using = RetentionPolicyPolicyTypeField.RetentionPolicyPolicyTypeFieldSerializer.class)
24
  @JsonProperty("policy_type")
25
  protected EnumWrapper<RetentionPolicyPolicyTypeField> policyType;
26

27
  @JsonDeserialize(
28
      using = RetentionPolicyRetentionTypeField.RetentionPolicyRetentionTypeFieldDeserializer.class)
29
  @JsonSerialize(
30
      using = RetentionPolicyRetentionTypeField.RetentionPolicyRetentionTypeFieldSerializer.class)
31
  @JsonProperty("retention_type")
32
  protected EnumWrapper<RetentionPolicyRetentionTypeField> retentionType;
33

34
  @JsonDeserialize(using = RetentionPolicyStatusField.RetentionPolicyStatusFieldDeserializer.class)
35
  @JsonSerialize(using = RetentionPolicyStatusField.RetentionPolicyStatusFieldSerializer.class)
36
  protected EnumWrapper<RetentionPolicyStatusField> status;
37

38
  @JsonProperty("created_by")
39
  protected UserMini createdBy;
40

41
  @JsonProperty("created_at")
42
  @JsonSerialize(using = DateTimeUtils.DateTimeSerializer.class)
43
  @JsonDeserialize(using = DateTimeUtils.DateTimeDeserializer.class)
44
  protected Date createdAt;
45

46
  @JsonProperty("modified_at")
47
  @JsonSerialize(using = DateTimeUtils.DateTimeSerializer.class)
48
  @JsonDeserialize(using = DateTimeUtils.DateTimeDeserializer.class)
49
  protected Date modifiedAt;
50

51
  @JsonProperty("can_owner_extend_retention")
52
  protected Boolean canOwnerExtendRetention;
53

54
  @JsonProperty("are_owners_notified")
55
  protected Boolean areOwnersNotified;
56

57
  @JsonProperty("custom_notification_recipients")
58
  protected List<UserMini> customNotificationRecipients;
59

60
  @JsonProperty("assignment_counts")
61
  protected RetentionPolicyAssignmentCountsField assignmentCounts;
62

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

67
  protected RetentionPolicy(Builder builder) {
68
    super(builder);
×
69
    this.description = builder.description;
×
70
    this.policyType = builder.policyType;
×
71
    this.retentionType = builder.retentionType;
×
72
    this.status = builder.status;
×
73
    this.createdBy = builder.createdBy;
×
74
    this.createdAt = builder.createdAt;
×
75
    this.modifiedAt = builder.modifiedAt;
×
76
    this.canOwnerExtendRetention = builder.canOwnerExtendRetention;
×
77
    this.areOwnersNotified = builder.areOwnersNotified;
×
78
    this.customNotificationRecipients = builder.customNotificationRecipients;
×
79
    this.assignmentCounts = builder.assignmentCounts;
×
80
  }
×
81

82
  public String getDescription() {
83
    return description;
1✔
84
  }
85

86
  public EnumWrapper<RetentionPolicyPolicyTypeField> getPolicyType() {
87
    return policyType;
×
88
  }
89

90
  public EnumWrapper<RetentionPolicyRetentionTypeField> getRetentionType() {
91
    return retentionType;
1✔
92
  }
93

94
  public EnumWrapper<RetentionPolicyStatusField> getStatus() {
95
    return status;
×
96
  }
97

98
  public UserMini getCreatedBy() {
99
    return createdBy;
×
100
  }
101

102
  public Date getCreatedAt() {
103
    return createdAt;
×
104
  }
105

106
  public Date getModifiedAt() {
107
    return modifiedAt;
×
108
  }
109

110
  public Boolean getCanOwnerExtendRetention() {
111
    return canOwnerExtendRetention;
1✔
112
  }
113

114
  public Boolean getAreOwnersNotified() {
115
    return areOwnersNotified;
×
116
  }
117

118
  public List<UserMini> getCustomNotificationRecipients() {
119
    return customNotificationRecipients;
×
120
  }
121

122
  public RetentionPolicyAssignmentCountsField getAssignmentCounts() {
123
    return assignmentCounts;
×
124
  }
125

126
  @Override
127
  public boolean equals(Object o) {
128
    if (this == o) {
×
129
      return true;
×
130
    }
131
    if (o == null || getClass() != o.getClass()) {
×
132
      return false;
×
133
    }
134
    RetentionPolicy casted = (RetentionPolicy) o;
×
135
    return Objects.equals(id, casted.id)
×
136
        && Objects.equals(type, casted.type)
×
137
        && Objects.equals(policyName, casted.policyName)
×
138
        && Objects.equals(retentionLength, casted.retentionLength)
×
139
        && Objects.equals(dispositionAction, casted.dispositionAction)
×
140
        && Objects.equals(description, casted.description)
×
141
        && Objects.equals(policyType, casted.policyType)
×
142
        && Objects.equals(retentionType, casted.retentionType)
×
143
        && Objects.equals(status, casted.status)
×
144
        && Objects.equals(createdBy, casted.createdBy)
×
145
        && Objects.equals(createdAt, casted.createdAt)
×
146
        && Objects.equals(modifiedAt, casted.modifiedAt)
×
147
        && Objects.equals(canOwnerExtendRetention, casted.canOwnerExtendRetention)
×
148
        && Objects.equals(areOwnersNotified, casted.areOwnersNotified)
×
149
        && Objects.equals(customNotificationRecipients, casted.customNotificationRecipients)
×
150
        && Objects.equals(assignmentCounts, casted.assignmentCounts);
×
151
  }
152

153
  @Override
154
  public int hashCode() {
155
    return Objects.hash(
×
156
        id,
157
        type,
158
        policyName,
159
        retentionLength,
160
        dispositionAction,
161
        description,
162
        policyType,
163
        retentionType,
164
        status,
165
        createdBy,
166
        createdAt,
167
        modifiedAt,
168
        canOwnerExtendRetention,
169
        areOwnersNotified,
170
        customNotificationRecipients,
171
        assignmentCounts);
172
  }
173

174
  @Override
175
  public String toString() {
176
    return "RetentionPolicy{"
×
177
        + "id='"
178
        + id
179
        + '\''
180
        + ", "
181
        + "type='"
182
        + type
183
        + '\''
184
        + ", "
185
        + "policyName='"
186
        + policyName
187
        + '\''
188
        + ", "
189
        + "retentionLength='"
190
        + retentionLength
191
        + '\''
192
        + ", "
193
        + "dispositionAction='"
194
        + dispositionAction
195
        + '\''
196
        + ", "
197
        + "description='"
198
        + description
199
        + '\''
200
        + ", "
201
        + "policyType='"
202
        + policyType
203
        + '\''
204
        + ", "
205
        + "retentionType='"
206
        + retentionType
207
        + '\''
208
        + ", "
209
        + "status='"
210
        + status
211
        + '\''
212
        + ", "
213
        + "createdBy='"
214
        + createdBy
215
        + '\''
216
        + ", "
217
        + "createdAt='"
218
        + createdAt
219
        + '\''
220
        + ", "
221
        + "modifiedAt='"
222
        + modifiedAt
223
        + '\''
224
        + ", "
225
        + "canOwnerExtendRetention='"
226
        + canOwnerExtendRetention
227
        + '\''
228
        + ", "
229
        + "areOwnersNotified='"
230
        + areOwnersNotified
231
        + '\''
232
        + ", "
233
        + "customNotificationRecipients='"
234
        + customNotificationRecipients
235
        + '\''
236
        + ", "
237
        + "assignmentCounts='"
238
        + assignmentCounts
239
        + '\''
240
        + "}";
241
  }
242

243
  public static class Builder extends RetentionPolicyMini.Builder {
244

245
    protected String description;
246

247
    protected EnumWrapper<RetentionPolicyPolicyTypeField> policyType;
248

249
    protected EnumWrapper<RetentionPolicyRetentionTypeField> retentionType;
250

251
    protected EnumWrapper<RetentionPolicyStatusField> status;
252

253
    protected UserMini createdBy;
254

255
    protected Date createdAt;
256

257
    protected Date modifiedAt;
258

259
    protected Boolean canOwnerExtendRetention;
260

261
    protected Boolean areOwnersNotified;
262

263
    protected List<UserMini> customNotificationRecipients;
264

265
    protected RetentionPolicyAssignmentCountsField assignmentCounts;
266

267
    public Builder(String id) {
268
      super(id);
×
269
    }
×
270

271
    public Builder description(String description) {
272
      this.description = description;
×
273
      return this;
×
274
    }
275

276
    public Builder policyType(RetentionPolicyPolicyTypeField policyType) {
277
      this.policyType = new EnumWrapper<RetentionPolicyPolicyTypeField>(policyType);
×
278
      return this;
×
279
    }
280

281
    public Builder policyType(EnumWrapper<RetentionPolicyPolicyTypeField> policyType) {
UNCOV
282
      this.policyType = policyType;
×
283
      return this;
×
284
    }
285

286
    public Builder retentionType(RetentionPolicyRetentionTypeField retentionType) {
287
      this.retentionType = new EnumWrapper<RetentionPolicyRetentionTypeField>(retentionType);
×
288
      return this;
×
289
    }
290

291
    public Builder retentionType(EnumWrapper<RetentionPolicyRetentionTypeField> retentionType) {
UNCOV
292
      this.retentionType = retentionType;
×
293
      return this;
×
294
    }
295

296
    public Builder status(RetentionPolicyStatusField status) {
297
      this.status = new EnumWrapper<RetentionPolicyStatusField>(status);
×
298
      return this;
×
299
    }
300

301
    public Builder status(EnumWrapper<RetentionPolicyStatusField> status) {
302
      this.status = status;
×
303
      return this;
×
304
    }
305

306
    public Builder createdBy(UserMini createdBy) {
307
      this.createdBy = createdBy;
×
308
      return this;
×
309
    }
310

311
    public Builder createdAt(Date createdAt) {
312
      this.createdAt = createdAt;
×
313
      return this;
×
314
    }
315

316
    public Builder modifiedAt(Date modifiedAt) {
317
      this.modifiedAt = modifiedAt;
×
318
      return this;
×
319
    }
320

321
    public Builder canOwnerExtendRetention(Boolean canOwnerExtendRetention) {
322
      this.canOwnerExtendRetention = canOwnerExtendRetention;
×
323
      return this;
×
324
    }
325

326
    public Builder areOwnersNotified(Boolean areOwnersNotified) {
327
      this.areOwnersNotified = areOwnersNotified;
×
328
      return this;
×
329
    }
330

331
    public Builder customNotificationRecipients(List<UserMini> customNotificationRecipients) {
UNCOV
332
      this.customNotificationRecipients = customNotificationRecipients;
×
333
      return this;
×
334
    }
335

336
    public Builder assignmentCounts(RetentionPolicyAssignmentCountsField assignmentCounts) {
UNCOV
337
      this.assignmentCounts = assignmentCounts;
×
338
      return this;
×
339
    }
340

341
    @Override
342
    public Builder type(RetentionPolicyBaseTypeField type) {
343
      this.type = new EnumWrapper<RetentionPolicyBaseTypeField>(type);
×
344
      return this;
×
345
    }
346

347
    @Override
348
    public Builder type(EnumWrapper<RetentionPolicyBaseTypeField> type) {
349
      this.type = type;
×
350
      return this;
×
351
    }
352

353
    @Override
354
    public Builder policyName(String policyName) {
355
      this.policyName = policyName;
×
356
      return this;
×
357
    }
358

359
    @Override
360
    public Builder retentionLength(String retentionLength) {
361
      this.retentionLength = retentionLength;
×
362
      return this;
×
363
    }
364

365
    @Override
366
    public Builder dispositionAction(RetentionPolicyMiniDispositionActionField dispositionAction) {
UNCOV
367
      this.dispositionAction =
×
368
          new EnumWrapper<RetentionPolicyMiniDispositionActionField>(dispositionAction);
369
      return this;
×
370
    }
371

372
    @Override
373
    public Builder dispositionAction(
374
        EnumWrapper<RetentionPolicyMiniDispositionActionField> dispositionAction) {
375
      this.dispositionAction = dispositionAction;
×
376
      return this;
×
377
    }
378

379
    public RetentionPolicy build() {
380
      return new RetentionPolicy(this);
×
381
    }
382
  }
383
}
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