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

box / box-java-sdk-gen / #294

24 Jun 2025 01:20PM UTC coverage: 35.662% (+0.03%) from 35.632%
#294

Pull #347

github

web-flow
Merge 2c100d09c into d8480ee6c
Pull Request #347: feat: Add Webhook Validation In Java (box/box-codegen#745)

68 of 82 new or added lines in 2 files covered. (82.93%)

11791 existing lines in 624 files now uncovered.

16939 of 47499 relevant lines covered (35.66%)

0.36 hits per line

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

5.38
/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.JsonFilter;
10
import com.fasterxml.jackson.annotation.JsonProperty;
11
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
12
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
13
import java.util.Date;
14
import java.util.List;
15
import java.util.Objects;
16

17
@JsonFilter("nullablePropertyFilter")
18
public class RetentionPolicy extends RetentionPolicyMini {
19

20
  protected String description;
21

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

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

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

40
  @JsonProperty("created_by")
41
  protected UserMini createdBy;
42

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

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

53
  @JsonProperty("can_owner_extend_retention")
54
  protected Boolean canOwnerExtendRetention;
55

56
  @JsonProperty("are_owners_notified")
57
  protected Boolean areOwnersNotified;
58

59
  @JsonProperty("custom_notification_recipients")
60
  protected List<UserMini> customNotificationRecipients;
61

62
  @JsonProperty("assignment_counts")
63
  protected RetentionPolicyAssignmentCountsField assignmentCounts;
64

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

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

85
  public String getDescription() {
86
    return description;
1✔
87
  }
88

89
  public EnumWrapper<RetentionPolicyPolicyTypeField> getPolicyType() {
UNCOV
90
    return policyType;
×
91
  }
92

93
  public EnumWrapper<RetentionPolicyRetentionTypeField> getRetentionType() {
94
    return retentionType;
1✔
95
  }
96

97
  public EnumWrapper<RetentionPolicyStatusField> getStatus() {
UNCOV
98
    return status;
×
99
  }
100

101
  public UserMini getCreatedBy() {
UNCOV
102
    return createdBy;
×
103
  }
104

105
  public Date getCreatedAt() {
UNCOV
106
    return createdAt;
×
107
  }
108

109
  public Date getModifiedAt() {
UNCOV
110
    return modifiedAt;
×
111
  }
112

113
  public Boolean getCanOwnerExtendRetention() {
114
    return canOwnerExtendRetention;
1✔
115
  }
116

117
  public Boolean getAreOwnersNotified() {
UNCOV
118
    return areOwnersNotified;
×
119
  }
120

121
  public List<UserMini> getCustomNotificationRecipients() {
UNCOV
122
    return customNotificationRecipients;
×
123
  }
124

125
  public RetentionPolicyAssignmentCountsField getAssignmentCounts() {
UNCOV
126
    return assignmentCounts;
×
127
  }
128

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

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

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

246
  public static class Builder extends RetentionPolicyMini.Builder {
247

248
    protected String description;
249

250
    protected EnumWrapper<RetentionPolicyPolicyTypeField> policyType;
251

252
    protected EnumWrapper<RetentionPolicyRetentionTypeField> retentionType;
253

254
    protected EnumWrapper<RetentionPolicyStatusField> status;
255

256
    protected UserMini createdBy;
257

258
    protected Date createdAt;
259

260
    protected Date modifiedAt;
261

262
    protected Boolean canOwnerExtendRetention;
263

264
    protected Boolean areOwnersNotified;
265

266
    protected List<UserMini> customNotificationRecipients;
267

268
    protected RetentionPolicyAssignmentCountsField assignmentCounts;
269

270
    public Builder(String id) {
UNCOV
271
      super(id);
×
272
    }
×
273

274
    public Builder description(String description) {
UNCOV
275
      this.description = description;
×
UNCOV
276
      return this;
×
277
    }
278

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

284
    public Builder policyType(EnumWrapper<RetentionPolicyPolicyTypeField> policyType) {
UNCOV
285
      this.policyType = policyType;
×
UNCOV
286
      return this;
×
287
    }
288

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

294
    public Builder retentionType(EnumWrapper<RetentionPolicyRetentionTypeField> retentionType) {
UNCOV
295
      this.retentionType = retentionType;
×
UNCOV
296
      return this;
×
297
    }
298

299
    public Builder status(RetentionPolicyStatusField status) {
UNCOV
300
      this.status = new EnumWrapper<RetentionPolicyStatusField>(status);
×
UNCOV
301
      return this;
×
302
    }
303

304
    public Builder status(EnumWrapper<RetentionPolicyStatusField> status) {
UNCOV
305
      this.status = status;
×
UNCOV
306
      return this;
×
307
    }
308

309
    public Builder createdBy(UserMini createdBy) {
UNCOV
310
      this.createdBy = createdBy;
×
UNCOV
311
      return this;
×
312
    }
313

314
    public Builder createdAt(Date createdAt) {
UNCOV
315
      this.createdAt = createdAt;
×
UNCOV
316
      return this;
×
317
    }
318

319
    public Builder modifiedAt(Date modifiedAt) {
UNCOV
320
      this.modifiedAt = modifiedAt;
×
UNCOV
321
      return this;
×
322
    }
323

324
    public Builder canOwnerExtendRetention(Boolean canOwnerExtendRetention) {
UNCOV
325
      this.canOwnerExtendRetention = canOwnerExtendRetention;
×
UNCOV
326
      return this;
×
327
    }
328

329
    public Builder areOwnersNotified(Boolean areOwnersNotified) {
UNCOV
330
      this.areOwnersNotified = areOwnersNotified;
×
UNCOV
331
      return this;
×
332
    }
333

334
    public Builder customNotificationRecipients(List<UserMini> customNotificationRecipients) {
UNCOV
335
      this.customNotificationRecipients = customNotificationRecipients;
×
UNCOV
336
      return this;
×
337
    }
338

339
    public Builder assignmentCounts(RetentionPolicyAssignmentCountsField assignmentCounts) {
UNCOV
340
      this.assignmentCounts = assignmentCounts;
×
UNCOV
341
      return this;
×
342
    }
343

344
    @Override
345
    public Builder type(RetentionPolicyBaseTypeField type) {
UNCOV
346
      this.type = new EnumWrapper<RetentionPolicyBaseTypeField>(type);
×
UNCOV
347
      return this;
×
348
    }
349

350
    @Override
351
    public Builder type(EnumWrapper<RetentionPolicyBaseTypeField> type) {
UNCOV
352
      this.type = type;
×
UNCOV
353
      return this;
×
354
    }
355

356
    @Override
357
    public Builder policyName(String policyName) {
UNCOV
358
      this.policyName = policyName;
×
UNCOV
359
      return this;
×
360
    }
361

362
    @Override
363
    public Builder retentionLength(String retentionLength) {
UNCOV
364
      this.retentionLength = retentionLength;
×
UNCOV
365
      return this;
×
366
    }
367

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

375
    @Override
376
    public Builder dispositionAction(
377
        EnumWrapper<RetentionPolicyMiniDispositionActionField> dispositionAction) {
UNCOV
378
      this.dispositionAction = dispositionAction;
×
UNCOV
379
      return this;
×
380
    }
381

382
    public RetentionPolicy build() {
UNCOV
383
      return new RetentionPolicy(this);
×
384
    }
385
  }
386
}
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