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

box / box-java-sdk / #6942

06 May 2026 07:36AM UTC coverage: 12.528% (-0.009%) from 12.537%
#6942

push

github

web-flow
fix(boxsdkgen): Fix metadata template schema (box/box-openapi#596) (#1829)

Co-authored-by: box-sdk-build <box-sdk-build@box.com>

0 of 52 new or added lines in 4 files covered. (0.0%)

1 existing line in 1 file now uncovered.

8374 of 66842 relevant lines covered (12.53%)

0.13 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/metadatatemplate/MetadataTemplateFieldsField.java
1
package com.box.sdkgen.schemas.metadatatemplate;
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
@JsonFilter("nullablePropertyFilter")
14
public class MetadataTemplateFieldsField extends SerializableObject {
15

16
  /**
17
   * The type of field. The basic fields are a `string` field for text, a `float` field for numbers,
18
   * and a `date` fields to present the user with a date-time picker.
19
   *
20
   * <p>Additionally, metadata templates support an `enum` field for a basic list of items, and
21
   * `multiSelect` field for a similar list of items where the user can select more than one value.
22
   *
23
   * <p>Metadata taxonomies are also supported as a `taxonomy` field type with a specific set of
24
   * additional properties, which describe its structure.
25
   *
26
   * <p>**Note**: The `integer` value is deprecated. It is still present in the response, but cannot
27
   * be used in the POST request.
28
   */
29
  @JsonDeserialize(
30
      using = MetadataTemplateFieldsTypeField.MetadataTemplateFieldsTypeFieldDeserializer.class)
31
  @JsonSerialize(
32
      using = MetadataTemplateFieldsTypeField.MetadataTemplateFieldsTypeFieldSerializer.class)
33
  protected final EnumWrapper<MetadataTemplateFieldsTypeField> type;
34

35
  /**
36
   * A unique identifier for the field. The identifier must be unique within the template to which
37
   * it belongs.
38
   */
39
  protected final String key;
40

41
  /** The display name of the field as it is shown to the user in the web and mobile apps. */
42
  protected final String displayName;
43

44
  /** A description of the field. This is not shown to the user. */
45
  protected String description;
46

47
  /**
48
   * Whether this field is hidden in the UI for the user and can only be set through the API
49
   * instead.
50
   */
51
  protected Boolean hidden;
52

53
  /**
54
   * A list of options for this field. This is used in combination with the `enum` and `multiSelect`
55
   * field types.
56
   */
57
  protected List<MetadataTemplateFieldsOptionsField> options;
58

59
  /**
60
   * The unique key of the metadata taxonomy to use for this taxonomy field. This property is
61
   * required when the field `type` is set to `taxonomy`.
62
   */
63
  protected String taxonomyKey;
64

65
  /**
66
   * The unique ID of the metadata taxonomy to use for this taxonomy field. This property is
67
   * required when the field `type` is set to `taxonomy`.
68
   */
69
  protected String taxonomyId;
70

71
  /**
72
   * The namespace of the metadata taxonomy to use for this taxonomy field. This property is
73
   * required when the field `type` is set to `taxonomy`.
74
   */
75
  protected String namespace;
76

77
  /**
78
   * An object defining additional rules for the options of the taxonomy field. This property is
79
   * required when the field `type` is set to `taxonomy`.
80
   */
81
  protected MetadataTemplateFieldsOptionsRulesField optionsRules;
82

83
  /** The unique ID of the metadata template field. */
84
  protected String id;
85

86
  public MetadataTemplateFieldsField(
87
      MetadataTemplateFieldsTypeField type, String key, String displayName) {
88
    super();
×
89
    this.type = new EnumWrapper<MetadataTemplateFieldsTypeField>(type);
×
90
    this.key = key;
×
91
    this.displayName = displayName;
×
92
  }
×
93

94
  public MetadataTemplateFieldsField(
95
      @JsonProperty("type") EnumWrapper<MetadataTemplateFieldsTypeField> type,
96
      @JsonProperty("key") String key,
97
      @JsonProperty("displayName") String displayName) {
98
    super();
×
99
    this.type = type;
×
100
    this.key = key;
×
101
    this.displayName = displayName;
×
102
  }
×
103

104
  protected MetadataTemplateFieldsField(Builder builder) {
105
    super();
×
106
    this.type = builder.type;
×
107
    this.key = builder.key;
×
108
    this.displayName = builder.displayName;
×
109
    this.description = builder.description;
×
110
    this.hidden = builder.hidden;
×
111
    this.options = builder.options;
×
NEW
112
    this.taxonomyKey = builder.taxonomyKey;
×
NEW
113
    this.taxonomyId = builder.taxonomyId;
×
NEW
114
    this.namespace = builder.namespace;
×
NEW
115
    this.optionsRules = builder.optionsRules;
×
116
    this.id = builder.id;
×
117
    markNullableFieldsAsSet(builder.getExplicitlySetNullableFields());
×
118
  }
×
119

120
  public EnumWrapper<MetadataTemplateFieldsTypeField> getType() {
121
    return type;
×
122
  }
123

124
  public String getKey() {
125
    return key;
×
126
  }
127

128
  public String getDisplayName() {
129
    return displayName;
×
130
  }
131

132
  public String getDescription() {
133
    return description;
×
134
  }
135

136
  public Boolean getHidden() {
137
    return hidden;
×
138
  }
139

140
  public List<MetadataTemplateFieldsOptionsField> getOptions() {
141
    return options;
×
142
  }
143

144
  public String getTaxonomyKey() {
NEW
145
    return taxonomyKey;
×
146
  }
147

148
  public String getTaxonomyId() {
NEW
149
    return taxonomyId;
×
150
  }
151

152
  public String getNamespace() {
NEW
153
    return namespace;
×
154
  }
155

156
  public MetadataTemplateFieldsOptionsRulesField getOptionsRules() {
NEW
157
    return optionsRules;
×
158
  }
159

160
  public String getId() {
161
    return id;
×
162
  }
163

164
  @Override
165
  public boolean equals(Object o) {
166
    if (this == o) {
×
167
      return true;
×
168
    }
169
    if (o == null || getClass() != o.getClass()) {
×
170
      return false;
×
171
    }
172
    MetadataTemplateFieldsField casted = (MetadataTemplateFieldsField) o;
×
173
    return Objects.equals(type, casted.type)
×
174
        && Objects.equals(key, casted.key)
×
175
        && Objects.equals(displayName, casted.displayName)
×
176
        && Objects.equals(description, casted.description)
×
177
        && Objects.equals(hidden, casted.hidden)
×
178
        && Objects.equals(options, casted.options)
×
NEW
179
        && Objects.equals(taxonomyKey, casted.taxonomyKey)
×
NEW
180
        && Objects.equals(taxonomyId, casted.taxonomyId)
×
NEW
181
        && Objects.equals(namespace, casted.namespace)
×
NEW
182
        && Objects.equals(optionsRules, casted.optionsRules)
×
UNCOV
183
        && Objects.equals(id, casted.id);
×
184
  }
185

186
  @Override
187
  public int hashCode() {
NEW
188
    return Objects.hash(
×
189
        type,
190
        key,
191
        displayName,
192
        description,
193
        hidden,
194
        options,
195
        taxonomyKey,
196
        taxonomyId,
197
        namespace,
198
        optionsRules,
199
        id);
200
  }
201

202
  @Override
203
  public String toString() {
204
    return "MetadataTemplateFieldsField{"
×
205
        + "type='"
206
        + type
207
        + '\''
208
        + ", "
209
        + "key='"
210
        + key
211
        + '\''
212
        + ", "
213
        + "displayName='"
214
        + displayName
215
        + '\''
216
        + ", "
217
        + "description='"
218
        + description
219
        + '\''
220
        + ", "
221
        + "hidden='"
222
        + hidden
223
        + '\''
224
        + ", "
225
        + "options='"
226
        + options
227
        + '\''
228
        + ", "
229
        + "taxonomyKey='"
230
        + taxonomyKey
231
        + '\''
232
        + ", "
233
        + "taxonomyId='"
234
        + taxonomyId
235
        + '\''
236
        + ", "
237
        + "namespace='"
238
        + namespace
239
        + '\''
240
        + ", "
241
        + "optionsRules='"
242
        + optionsRules
243
        + '\''
244
        + ", "
245
        + "id='"
246
        + id
247
        + '\''
248
        + "}";
249
  }
250

251
  public static class Builder extends NullableFieldTracker {
252

253
    protected final EnumWrapper<MetadataTemplateFieldsTypeField> type;
254

255
    protected final String key;
256

257
    protected final String displayName;
258

259
    protected String description;
260

261
    protected Boolean hidden;
262

263
    protected List<MetadataTemplateFieldsOptionsField> options;
264

265
    protected String taxonomyKey;
266

267
    protected String taxonomyId;
268

269
    protected String namespace;
270

271
    protected MetadataTemplateFieldsOptionsRulesField optionsRules;
272

273
    protected String id;
274

275
    public Builder(MetadataTemplateFieldsTypeField type, String key, String displayName) {
276
      super();
×
277
      this.type = new EnumWrapper<MetadataTemplateFieldsTypeField>(type);
×
278
      this.key = key;
×
279
      this.displayName = displayName;
×
280
    }
×
281

282
    public Builder(
283
        EnumWrapper<MetadataTemplateFieldsTypeField> type, String key, String displayName) {
284
      super();
×
285
      this.type = type;
×
286
      this.key = key;
×
287
      this.displayName = displayName;
×
288
    }
×
289

290
    public Builder description(String description) {
291
      this.description = description;
×
292
      return this;
×
293
    }
294

295
    public Builder hidden(Boolean hidden) {
296
      this.hidden = hidden;
×
297
      return this;
×
298
    }
299

300
    public Builder options(List<MetadataTemplateFieldsOptionsField> options) {
301
      this.options = options;
×
302
      return this;
×
303
    }
304

305
    public Builder taxonomyKey(String taxonomyKey) {
NEW
306
      this.taxonomyKey = taxonomyKey;
×
NEW
307
      return this;
×
308
    }
309

310
    public Builder taxonomyId(String taxonomyId) {
NEW
311
      this.taxonomyId = taxonomyId;
×
NEW
312
      return this;
×
313
    }
314

315
    public Builder namespace(String namespace) {
NEW
316
      this.namespace = namespace;
×
NEW
317
      return this;
×
318
    }
319

320
    public Builder optionsRules(MetadataTemplateFieldsOptionsRulesField optionsRules) {
NEW
321
      this.optionsRules = optionsRules;
×
NEW
322
      return this;
×
323
    }
324

325
    public Builder id(String id) {
326
      this.id = id;
×
327
      return this;
×
328
    }
329

330
    public MetadataTemplateFieldsField build() {
331
      return new MetadataTemplateFieldsField(this);
×
332
    }
333
  }
334
}
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