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

box / box-java-sdk / #6242

10 Feb 2026 05:27PM UTC coverage: 35.714% (+11.4%) from 24.324%
#6242

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%)

2146 existing lines in 544 files now uncovered.

7382 of 20670 relevant lines covered (35.71%)

0.4 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/classificationtemplate/ClassificationTemplate.java
1
package com.box.sdkgen.schemas.classificationtemplate;
2

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

13
/** A metadata template that holds the security classifications defined by an enterprise. */
14
@JsonFilter("nullablePropertyFilter")
15
public class ClassificationTemplate extends SerializableObject {
16

17
  /** The ID of the classification template. */
18
  protected final String id;
19

20
  /** The value will always be `metadata_template`. */
21
  @JsonDeserialize(
22
      using = ClassificationTemplateTypeField.ClassificationTemplateTypeFieldDeserializer.class)
23
  @JsonSerialize(
24
      using = ClassificationTemplateTypeField.ClassificationTemplateTypeFieldSerializer.class)
25
  protected EnumWrapper<ClassificationTemplateTypeField> type;
26

27
  /**
28
   * The scope of the classification template. This is in the format `enterprise_{id}` where the
29
   * `id` is the enterprise ID.
30
   */
31
  protected final String scope;
32

33
  /** The value will always be `securityClassification-6VMVochwUWo`. */
34
  @JsonDeserialize(
35
      using =
36
          ClassificationTemplateTemplateKeyField.ClassificationTemplateTemplateKeyFieldDeserializer
37
              .class)
38
  @JsonSerialize(
39
      using =
40
          ClassificationTemplateTemplateKeyField.ClassificationTemplateTemplateKeyFieldSerializer
41
              .class)
42
  protected EnumWrapper<ClassificationTemplateTemplateKeyField> templateKey;
43

44
  /** The name of this template as shown in web and mobile interfaces. */
45
  @JsonDeserialize(
46
      using =
47
          ClassificationTemplateDisplayNameField.ClassificationTemplateDisplayNameFieldDeserializer
48
              .class)
49
  @JsonSerialize(
50
      using =
51
          ClassificationTemplateDisplayNameField.ClassificationTemplateDisplayNameFieldSerializer
52
              .class)
53
  protected EnumWrapper<ClassificationTemplateDisplayNameField> displayName;
54

55
  /** Determines if the template is always available in web and mobile interfaces. */
56
  protected Boolean hidden;
57

58
  /** Determines if classifications are copied along when the file or folder is copied. */
59
  protected Boolean copyInstanceOnItemCopy;
60

61
  /**
62
   * A list of fields for this classification template. This includes only one field, the
63
   * `Box__Security__Classification__Key`, which defines the different classifications available in
64
   * this enterprise.
65
   */
66
  protected final List<ClassificationTemplateFieldsField> fields;
67

68
  public ClassificationTemplate(
69
      @JsonProperty("id") String id,
70
      @JsonProperty("scope") String scope,
71
      @JsonProperty("fields") List<ClassificationTemplateFieldsField> fields) {
72
    super();
×
73
    this.id = id;
×
74
    this.scope = scope;
×
75
    this.fields = fields;
×
76
    this.type =
×
77
        new EnumWrapper<ClassificationTemplateTypeField>(
78
            ClassificationTemplateTypeField.METADATA_TEMPLATE);
79
    this.templateKey =
×
80
        new EnumWrapper<ClassificationTemplateTemplateKeyField>(
81
            ClassificationTemplateTemplateKeyField.SECURITYCLASSIFICATION_6VMVOCHWUWO);
82
    this.displayName =
×
83
        new EnumWrapper<ClassificationTemplateDisplayNameField>(
84
            ClassificationTemplateDisplayNameField.CLASSIFICATION);
85
  }
×
86

87
  protected ClassificationTemplate(Builder builder) {
88
    super();
×
89
    this.id = builder.id;
×
90
    this.type = builder.type;
×
91
    this.scope = builder.scope;
×
92
    this.templateKey = builder.templateKey;
×
93
    this.displayName = builder.displayName;
×
94
    this.hidden = builder.hidden;
×
95
    this.copyInstanceOnItemCopy = builder.copyInstanceOnItemCopy;
×
96
    this.fields = builder.fields;
×
97
    markNullableFieldsAsSet(builder.getExplicitlySetNullableFields());
×
98
  }
×
99

100
  public String getId() {
101
    return id;
×
102
  }
103

104
  public EnumWrapper<ClassificationTemplateTypeField> getType() {
105
    return type;
×
106
  }
107

108
  public String getScope() {
109
    return scope;
×
110
  }
111

112
  public EnumWrapper<ClassificationTemplateTemplateKeyField> getTemplateKey() {
113
    return templateKey;
×
114
  }
115

116
  public EnumWrapper<ClassificationTemplateDisplayNameField> getDisplayName() {
117
    return displayName;
×
118
  }
119

120
  public Boolean getHidden() {
121
    return hidden;
×
122
  }
123

124
  public Boolean getCopyInstanceOnItemCopy() {
125
    return copyInstanceOnItemCopy;
×
126
  }
127

128
  public List<ClassificationTemplateFieldsField> getFields() {
129
    return fields;
×
130
  }
131

132
  @Override
133
  public boolean equals(Object o) {
134
    if (this == o) {
×
135
      return true;
×
136
    }
137
    if (o == null || getClass() != o.getClass()) {
×
138
      return false;
×
139
    }
140
    ClassificationTemplate casted = (ClassificationTemplate) o;
×
141
    return Objects.equals(id, casted.id)
×
142
        && Objects.equals(type, casted.type)
×
143
        && Objects.equals(scope, casted.scope)
×
144
        && Objects.equals(templateKey, casted.templateKey)
×
145
        && Objects.equals(displayName, casted.displayName)
×
146
        && Objects.equals(hidden, casted.hidden)
×
147
        && Objects.equals(copyInstanceOnItemCopy, casted.copyInstanceOnItemCopy)
×
148
        && Objects.equals(fields, casted.fields);
×
149
  }
150

151
  @Override
152
  public int hashCode() {
153
    return Objects.hash(
×
154
        id, type, scope, templateKey, displayName, hidden, copyInstanceOnItemCopy, fields);
155
  }
156

157
  @Override
158
  public String toString() {
159
    return "ClassificationTemplate{"
×
160
        + "id='"
161
        + id
162
        + '\''
163
        + ", "
164
        + "type='"
165
        + type
166
        + '\''
167
        + ", "
168
        + "scope='"
169
        + scope
170
        + '\''
171
        + ", "
172
        + "templateKey='"
173
        + templateKey
174
        + '\''
175
        + ", "
176
        + "displayName='"
177
        + displayName
178
        + '\''
179
        + ", "
180
        + "hidden='"
181
        + hidden
182
        + '\''
183
        + ", "
184
        + "copyInstanceOnItemCopy='"
185
        + copyInstanceOnItemCopy
186
        + '\''
187
        + ", "
188
        + "fields='"
189
        + fields
190
        + '\''
191
        + "}";
192
  }
193

194
  public static class Builder extends NullableFieldTracker {
195

196
    protected final String id;
197

198
    protected EnumWrapper<ClassificationTemplateTypeField> type;
199

200
    protected final String scope;
201

202
    protected EnumWrapper<ClassificationTemplateTemplateKeyField> templateKey;
203

204
    protected EnumWrapper<ClassificationTemplateDisplayNameField> displayName;
205

206
    protected Boolean hidden;
207

208
    protected Boolean copyInstanceOnItemCopy;
209

210
    protected final List<ClassificationTemplateFieldsField> fields;
211

212
    public Builder(String id, String scope, List<ClassificationTemplateFieldsField> fields) {
213
      super();
×
214
      this.id = id;
×
215
      this.scope = scope;
×
216
      this.fields = fields;
×
217
    }
×
218

219
    public Builder type(ClassificationTemplateTypeField type) {
UNCOV
220
      this.type = new EnumWrapper<ClassificationTemplateTypeField>(type);
×
221
      return this;
×
222
    }
223

224
    public Builder type(EnumWrapper<ClassificationTemplateTypeField> type) {
UNCOV
225
      this.type = type;
×
226
      return this;
×
227
    }
228

229
    public Builder templateKey(ClassificationTemplateTemplateKeyField templateKey) {
UNCOV
230
      this.templateKey = new EnumWrapper<ClassificationTemplateTemplateKeyField>(templateKey);
×
231
      return this;
×
232
    }
233

234
    public Builder templateKey(EnumWrapper<ClassificationTemplateTemplateKeyField> templateKey) {
UNCOV
235
      this.templateKey = templateKey;
×
236
      return this;
×
237
    }
238

239
    public Builder displayName(ClassificationTemplateDisplayNameField displayName) {
UNCOV
240
      this.displayName = new EnumWrapper<ClassificationTemplateDisplayNameField>(displayName);
×
241
      return this;
×
242
    }
243

244
    public Builder displayName(EnumWrapper<ClassificationTemplateDisplayNameField> displayName) {
UNCOV
245
      this.displayName = displayName;
×
246
      return this;
×
247
    }
248

249
    public Builder hidden(Boolean hidden) {
UNCOV
250
      this.hidden = hidden;
×
251
      return this;
×
252
    }
253

254
    public Builder copyInstanceOnItemCopy(Boolean copyInstanceOnItemCopy) {
UNCOV
255
      this.copyInstanceOnItemCopy = copyInstanceOnItemCopy;
×
256
      return this;
×
257
    }
258

259
    public ClassificationTemplate build() {
NEW
260
      if (this.type == null) {
×
NEW
261
        this.type =
×
262
            new EnumWrapper<ClassificationTemplateTypeField>(
263
                ClassificationTemplateTypeField.METADATA_TEMPLATE);
264
      }
NEW
265
      if (this.templateKey == null) {
×
NEW
266
        this.templateKey =
×
267
            new EnumWrapper<ClassificationTemplateTemplateKeyField>(
268
                ClassificationTemplateTemplateKeyField.SECURITYCLASSIFICATION_6VMVOCHWUWO);
269
      }
NEW
270
      if (this.displayName == null) {
×
NEW
271
        this.displayName =
×
272
            new EnumWrapper<ClassificationTemplateDisplayNameField>(
273
                ClassificationTemplateDisplayNameField.CLASSIFICATION);
274
      }
275
      return new ClassificationTemplate(this);
×
276
    }
277
  }
278
}
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