• 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

21.05
/src/main/java/com/box/sdkgen/schemas/storagepolicyassignment/StoragePolicyAssignment.java
1
package com.box.sdkgen.schemas.storagepolicyassignment;
2

3
import com.box.sdkgen.internal.SerializableObject;
4
import com.box.sdkgen.schemas.storagepolicymini.StoragePolicyMini;
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.Objects;
10

11
public class StoragePolicyAssignment extends SerializableObject {
12

13
  protected final String id;
14

15
  @JsonDeserialize(
16
      using = StoragePolicyAssignmentTypeField.StoragePolicyAssignmentTypeFieldDeserializer.class)
17
  @JsonSerialize(
18
      using = StoragePolicyAssignmentTypeField.StoragePolicyAssignmentTypeFieldSerializer.class)
19
  protected EnumWrapper<StoragePolicyAssignmentTypeField> type;
20

21
  @JsonProperty("storage_policy")
22
  protected StoragePolicyMini storagePolicy;
23

24
  @JsonProperty("assigned_to")
25
  protected StoragePolicyAssignmentAssignedToField assignedTo;
26

27
  public StoragePolicyAssignment(@JsonProperty("id") String id) {
28
    super();
1✔
29
    this.id = id;
1✔
30
    this.type =
1✔
31
        new EnumWrapper<StoragePolicyAssignmentTypeField>(
32
            StoragePolicyAssignmentTypeField.STORAGE_POLICY_ASSIGNMENT);
33
  }
1✔
34

35
  protected StoragePolicyAssignment(Builder builder) {
36
    super();
×
37
    this.id = builder.id;
×
38
    this.type = builder.type;
×
39
    this.storagePolicy = builder.storagePolicy;
×
40
    this.assignedTo = builder.assignedTo;
×
41
  }
×
42

43
  public String getId() {
44
    return id;
1✔
45
  }
46

47
  public EnumWrapper<StoragePolicyAssignmentTypeField> getType() {
48
    return type;
1✔
49
  }
50

51
  public StoragePolicyMini getStoragePolicy() {
52
    return storagePolicy;
1✔
53
  }
54

55
  public StoragePolicyAssignmentAssignedToField getAssignedTo() {
56
    return assignedTo;
1✔
57
  }
58

59
  @Override
60
  public boolean equals(Object o) {
61
    if (this == o) {
×
62
      return true;
×
63
    }
64
    if (o == null || getClass() != o.getClass()) {
×
65
      return false;
×
66
    }
67
    StoragePolicyAssignment casted = (StoragePolicyAssignment) o;
×
68
    return Objects.equals(id, casted.id)
×
69
        && Objects.equals(type, casted.type)
×
70
        && Objects.equals(storagePolicy, casted.storagePolicy)
×
71
        && Objects.equals(assignedTo, casted.assignedTo);
×
72
  }
73

74
  @Override
75
  public int hashCode() {
76
    return Objects.hash(id, type, storagePolicy, assignedTo);
×
77
  }
78

79
  @Override
80
  public String toString() {
81
    return "StoragePolicyAssignment{"
×
82
        + "id='"
83
        + id
84
        + '\''
85
        + ", "
86
        + "type='"
87
        + type
88
        + '\''
89
        + ", "
90
        + "storagePolicy='"
91
        + storagePolicy
92
        + '\''
93
        + ", "
94
        + "assignedTo='"
95
        + assignedTo
96
        + '\''
97
        + "}";
98
  }
99

100
  public static class Builder {
101

102
    protected final String id;
103

104
    protected EnumWrapper<StoragePolicyAssignmentTypeField> type;
105

106
    protected StoragePolicyMini storagePolicy;
107

108
    protected StoragePolicyAssignmentAssignedToField assignedTo;
109

NEW
110
    public Builder(String id) {
×
111
      this.id = id;
×
112
      this.type =
×
113
          new EnumWrapper<StoragePolicyAssignmentTypeField>(
114
              StoragePolicyAssignmentTypeField.STORAGE_POLICY_ASSIGNMENT);
115
    }
×
116

117
    public Builder type(StoragePolicyAssignmentTypeField type) {
118
      this.type = new EnumWrapper<StoragePolicyAssignmentTypeField>(type);
×
119
      return this;
×
120
    }
121

122
    public Builder type(EnumWrapper<StoragePolicyAssignmentTypeField> type) {
123
      this.type = type;
×
124
      return this;
×
125
    }
126

127
    public Builder storagePolicy(StoragePolicyMini storagePolicy) {
128
      this.storagePolicy = storagePolicy;
×
129
      return this;
×
130
    }
131

132
    public Builder assignedTo(StoragePolicyAssignmentAssignedToField assignedTo) {
UNCOV
133
      this.assignedTo = assignedTo;
×
134
      return this;
×
135
    }
136

137
    public StoragePolicyAssignment build() {
138
      return new StoragePolicyAssignment(this);
×
139
    }
140
  }
141
}
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