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

box / box-java-sdk / #6243

10 Feb 2026 05:27PM UTC coverage: 18.192% (-17.5%) from 35.714%
#6243

push

github

web-flow
fix(boxsdkgen): Move assigning default values from builder constructor to `build()` method (box/box-codegen#922) (#1712)

0 of 1677 new or added lines in 569 files covered. (0.0%)

2147 existing lines in 545 files now uncovered.

7388 of 40611 relevant lines covered (18.19%)

0.21 hits per line

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

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

3
import com.box.sdkgen.internal.NullableFieldTracker;
4
import com.box.sdkgen.internal.SerializableObject;
5
import com.box.sdkgen.schemas.storagepolicymini.StoragePolicyMini;
6
import com.box.sdkgen.serialization.json.EnumWrapper;
7
import com.fasterxml.jackson.annotation.JsonFilter;
8
import com.fasterxml.jackson.annotation.JsonProperty;
9
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
10
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
11
import java.util.Objects;
12

13
/** The assignment of a storage policy to a user or enterprise. */
14
@JsonFilter("nullablePropertyFilter")
15
public class StoragePolicyAssignment extends SerializableObject {
16

17
  /** The unique identifier for a storage policy assignment. */
18
  protected final String id;
19

20
  /** The value will always be `storage_policy_assignment`. */
21
  @JsonDeserialize(
22
      using = StoragePolicyAssignmentTypeField.StoragePolicyAssignmentTypeFieldDeserializer.class)
23
  @JsonSerialize(
24
      using = StoragePolicyAssignmentTypeField.StoragePolicyAssignmentTypeFieldSerializer.class)
25
  protected EnumWrapper<StoragePolicyAssignmentTypeField> type;
26

27
  @JsonProperty("storage_policy")
28
  protected StoragePolicyMini storagePolicy;
29

30
  @JsonProperty("assigned_to")
31
  protected StoragePolicyAssignmentAssignedToField assignedTo;
32

33
  public StoragePolicyAssignment(@JsonProperty("id") String id) {
34
    super();
×
35
    this.id = id;
×
36
    this.type =
×
37
        new EnumWrapper<StoragePolicyAssignmentTypeField>(
38
            StoragePolicyAssignmentTypeField.STORAGE_POLICY_ASSIGNMENT);
39
  }
×
40

41
  protected StoragePolicyAssignment(Builder builder) {
42
    super();
×
43
    this.id = builder.id;
×
44
    this.type = builder.type;
×
45
    this.storagePolicy = builder.storagePolicy;
×
46
    this.assignedTo = builder.assignedTo;
×
47
    markNullableFieldsAsSet(builder.getExplicitlySetNullableFields());
×
48
  }
×
49

50
  public String getId() {
51
    return id;
×
52
  }
53

54
  public EnumWrapper<StoragePolicyAssignmentTypeField> getType() {
55
    return type;
×
56
  }
57

58
  public StoragePolicyMini getStoragePolicy() {
59
    return storagePolicy;
×
60
  }
61

62
  public StoragePolicyAssignmentAssignedToField getAssignedTo() {
63
    return assignedTo;
×
64
  }
65

66
  @Override
67
  public boolean equals(Object o) {
68
    if (this == o) {
×
69
      return true;
×
70
    }
71
    if (o == null || getClass() != o.getClass()) {
×
72
      return false;
×
73
    }
74
    StoragePolicyAssignment casted = (StoragePolicyAssignment) o;
×
75
    return Objects.equals(id, casted.id)
×
76
        && Objects.equals(type, casted.type)
×
77
        && Objects.equals(storagePolicy, casted.storagePolicy)
×
78
        && Objects.equals(assignedTo, casted.assignedTo);
×
79
  }
80

81
  @Override
82
  public int hashCode() {
83
    return Objects.hash(id, type, storagePolicy, assignedTo);
×
84
  }
85

86
  @Override
87
  public String toString() {
88
    return "StoragePolicyAssignment{"
×
89
        + "id='"
90
        + id
91
        + '\''
92
        + ", "
93
        + "type='"
94
        + type
95
        + '\''
96
        + ", "
97
        + "storagePolicy='"
98
        + storagePolicy
99
        + '\''
100
        + ", "
101
        + "assignedTo='"
102
        + assignedTo
103
        + '\''
104
        + "}";
105
  }
106

107
  public static class Builder extends NullableFieldTracker {
108

109
    protected final String id;
110

111
    protected EnumWrapper<StoragePolicyAssignmentTypeField> type;
112

113
    protected StoragePolicyMini storagePolicy;
114

115
    protected StoragePolicyAssignmentAssignedToField assignedTo;
116

117
    public Builder(String id) {
118
      super();
×
119
      this.id = id;
×
120
    }
×
121

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

127
    public Builder type(EnumWrapper<StoragePolicyAssignmentTypeField> type) {
UNCOV
128
      this.type = type;
×
UNCOV
129
      return this;
×
130
    }
131

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

137
    public Builder assignedTo(StoragePolicyAssignmentAssignedToField assignedTo) {
UNCOV
138
      this.assignedTo = assignedTo;
×
UNCOV
139
      return this;
×
140
    }
141

142
    public StoragePolicyAssignment build() {
NEW
143
      if (this.type == null) {
×
NEW
144
        this.type =
×
145
            new EnumWrapper<StoragePolicyAssignmentTypeField>(
146
                StoragePolicyAssignmentTypeField.STORAGE_POLICY_ASSIGNMENT);
147
      }
UNCOV
148
      return new StoragePolicyAssignment(this);
×
149
    }
150
  }
151
}
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