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

box / box-java-sdk-gen / #358

11 Jul 2025 04:43PM UTC coverage: 38.091% (+2.5%) from 35.58%
#358

Pull #361

github

web-flow
Merge 112b63b24 into 426763c84
Pull Request #361: feat: Support common fields in Union in Java (box/box-codegen#758)

288 of 1203 new or added lines in 106 files covered. (23.94%)

167 existing lines in 45 files now uncovered.

18543 of 48681 relevant lines covered (38.09%)

0.38 hits per line

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

13.33
/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
  @JsonDeserialize(
17
      using = MetadataTemplateFieldsTypeField.MetadataTemplateFieldsTypeFieldDeserializer.class)
18
  @JsonSerialize(
19
      using = MetadataTemplateFieldsTypeField.MetadataTemplateFieldsTypeFieldSerializer.class)
20
  protected final EnumWrapper<MetadataTemplateFieldsTypeField> type;
21

22
  protected final String key;
23

24
  protected final String displayName;
25

26
  protected String description;
27

28
  protected Boolean hidden;
29

30
  protected List<MetadataTemplateFieldsOptionsField> options;
31

32
  protected String id;
33

34
  public MetadataTemplateFieldsField(
35
      MetadataTemplateFieldsTypeField type, String key, String displayName) {
UNCOV
36
    super();
×
NEW
37
    this.type = new EnumWrapper<MetadataTemplateFieldsTypeField>(type);
×
UNCOV
38
    this.key = key;
×
UNCOV
39
    this.displayName = displayName;
×
UNCOV
40
  }
×
41

42
  public MetadataTemplateFieldsField(
43
      @JsonProperty("type") EnumWrapper<MetadataTemplateFieldsTypeField> type,
44
      @JsonProperty("key") String key,
45
      @JsonProperty("displayName") String displayName) {
46
    super();
1✔
47
    this.type = type;
1✔
48
    this.key = key;
1✔
49
    this.displayName = displayName;
1✔
50
  }
1✔
51

52
  protected MetadataTemplateFieldsField(Builder builder) {
53
    super();
×
54
    this.type = builder.type;
×
55
    this.key = builder.key;
×
56
    this.displayName = builder.displayName;
×
57
    this.description = builder.description;
×
58
    this.hidden = builder.hidden;
×
59
    this.options = builder.options;
×
60
    this.id = builder.id;
×
61
    markNullableFieldsAsSet(builder.getExplicitlySetNullableFields());
×
62
  }
×
63

64
  public EnumWrapper<MetadataTemplateFieldsTypeField> getType() {
65
    return type;
1✔
66
  }
67

68
  public String getKey() {
69
    return key;
1✔
70
  }
71

72
  public String getDisplayName() {
73
    return displayName;
1✔
74
  }
75

76
  public String getDescription() {
77
    return description;
×
78
  }
79

80
  public Boolean getHidden() {
81
    return hidden;
×
82
  }
83

84
  public List<MetadataTemplateFieldsOptionsField> getOptions() {
85
    return options;
×
86
  }
87

88
  public String getId() {
89
    return id;
×
90
  }
91

92
  @Override
93
  public boolean equals(Object o) {
94
    if (this == o) {
×
95
      return true;
×
96
    }
97
    if (o == null || getClass() != o.getClass()) {
×
98
      return false;
×
99
    }
100
    MetadataTemplateFieldsField casted = (MetadataTemplateFieldsField) o;
×
101
    return Objects.equals(type, casted.type)
×
102
        && Objects.equals(key, casted.key)
×
103
        && Objects.equals(displayName, casted.displayName)
×
104
        && Objects.equals(description, casted.description)
×
105
        && Objects.equals(hidden, casted.hidden)
×
106
        && Objects.equals(options, casted.options)
×
107
        && Objects.equals(id, casted.id);
×
108
  }
109

110
  @Override
111
  public int hashCode() {
112
    return Objects.hash(type, key, displayName, description, hidden, options, id);
×
113
  }
114

115
  @Override
116
  public String toString() {
117
    return "MetadataTemplateFieldsField{"
×
118
        + "type='"
119
        + type
120
        + '\''
121
        + ", "
122
        + "key='"
123
        + key
124
        + '\''
125
        + ", "
126
        + "displayName='"
127
        + displayName
128
        + '\''
129
        + ", "
130
        + "description='"
131
        + description
132
        + '\''
133
        + ", "
134
        + "hidden='"
135
        + hidden
136
        + '\''
137
        + ", "
138
        + "options='"
139
        + options
140
        + '\''
141
        + ", "
142
        + "id='"
143
        + id
144
        + '\''
145
        + "}";
146
  }
147

148
  public static class Builder extends NullableFieldTracker {
149

150
    protected final EnumWrapper<MetadataTemplateFieldsTypeField> type;
151

152
    protected final String key;
153

154
    protected final String displayName;
155

156
    protected String description;
157

158
    protected Boolean hidden;
159

160
    protected List<MetadataTemplateFieldsOptionsField> options;
161

162
    protected String id;
163

164
    public Builder(MetadataTemplateFieldsTypeField type, String key, String displayName) {
UNCOV
165
      super();
×
NEW
166
      this.type = new EnumWrapper<MetadataTemplateFieldsTypeField>(type);
×
167
      this.key = key;
×
168
      this.displayName = displayName;
×
169
    }
×
170

171
    public Builder(
172
        EnumWrapper<MetadataTemplateFieldsTypeField> type, String key, String displayName) {
173
      super();
×
NEW
174
      this.type = type;
×
175
      this.key = key;
×
176
      this.displayName = displayName;
×
177
    }
×
178

179
    public Builder description(String description) {
180
      this.description = description;
×
181
      return this;
×
182
    }
183

184
    public Builder hidden(Boolean hidden) {
185
      this.hidden = hidden;
×
186
      return this;
×
187
    }
188

189
    public Builder options(List<MetadataTemplateFieldsOptionsField> options) {
190
      this.options = options;
×
191
      return this;
×
192
    }
193

194
    public Builder id(String id) {
195
      this.id = id;
×
196
      return this;
×
197
    }
198

199
    public MetadataTemplateFieldsField build() {
200
      return new MetadataTemplateFieldsField(this);
×
201
    }
202
  }
203
}
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