• 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

13.56
/src/main/java/com/box/sdkgen/schemas/metadatatemplate/MetadataTemplateFieldsField.java
1
package com.box.sdkgen.schemas.metadatatemplate;
2

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

11
public class MetadataTemplateFieldsField extends SerializableObject {
12

13
  @JsonDeserialize(
14
      using = MetadataTemplateFieldsTypeField.MetadataTemplateFieldsTypeFieldDeserializer.class)
15
  @JsonSerialize(
16
      using = MetadataTemplateFieldsTypeField.MetadataTemplateFieldsTypeFieldSerializer.class)
17
  protected final EnumWrapper<MetadataTemplateFieldsTypeField> type;
18

19
  protected final String key;
20

21
  protected final String displayName;
22

23
  protected String description;
24

25
  protected Boolean hidden;
26

27
  protected List<MetadataTemplateFieldsOptionsField> options;
28

29
  protected String id;
30

31
  public MetadataTemplateFieldsField(
32
      @JsonProperty("type") EnumWrapper<MetadataTemplateFieldsTypeField> type,
33
      @JsonProperty("key") String key,
34
      @JsonProperty("displayName") String displayName) {
35
    super();
1✔
36
    this.type = type;
1✔
37
    this.key = key;
1✔
38
    this.displayName = displayName;
1✔
39
  }
1✔
40

41
  public MetadataTemplateFieldsField(
42
      MetadataTemplateFieldsTypeField type, String key, String displayName) {
43
    super();
×
44
    this.type = new EnumWrapper<MetadataTemplateFieldsTypeField>(type);
×
45
    this.key = key;
×
46
    this.displayName = displayName;
×
47
  }
×
48

49
  protected MetadataTemplateFieldsField(Builder builder) {
50
    super();
×
51
    this.type = builder.type;
×
52
    this.key = builder.key;
×
53
    this.displayName = builder.displayName;
×
54
    this.description = builder.description;
×
55
    this.hidden = builder.hidden;
×
56
    this.options = builder.options;
×
57
    this.id = builder.id;
×
58
  }
×
59

60
  public EnumWrapper<MetadataTemplateFieldsTypeField> getType() {
61
    return type;
1✔
62
  }
63

64
  public String getKey() {
65
    return key;
1✔
66
  }
67

68
  public String getDisplayName() {
69
    return displayName;
1✔
70
  }
71

72
  public String getDescription() {
73
    return description;
×
74
  }
75

76
  public Boolean getHidden() {
77
    return hidden;
×
78
  }
79

80
  public List<MetadataTemplateFieldsOptionsField> getOptions() {
81
    return options;
×
82
  }
83

84
  public String getId() {
85
    return id;
×
86
  }
87

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

106
  @Override
107
  public int hashCode() {
108
    return Objects.hash(type, key, displayName, description, hidden, options, id);
×
109
  }
110

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

144
  public static class Builder {
145

146
    protected final EnumWrapper<MetadataTemplateFieldsTypeField> type;
147

148
    protected final String key;
149

150
    protected final String displayName;
151

152
    protected String description;
153

154
    protected Boolean hidden;
155

156
    protected List<MetadataTemplateFieldsOptionsField> options;
157

158
    protected String id;
159

160
    public Builder(
161
        EnumWrapper<MetadataTemplateFieldsTypeField> type, String key, String displayName) {
×
162
      this.type = type;
×
163
      this.key = key;
×
164
      this.displayName = displayName;
×
165
    }
×
166

NEW
167
    public Builder(MetadataTemplateFieldsTypeField type, String key, String displayName) {
×
168
      this.type = new EnumWrapper<MetadataTemplateFieldsTypeField>(type);
×
169
      this.key = key;
×
170
      this.displayName = displayName;
×
171
    }
×
172

173
    public Builder description(String description) {
174
      this.description = description;
×
175
      return this;
×
176
    }
177

178
    public Builder hidden(Boolean hidden) {
179
      this.hidden = hidden;
×
180
      return this;
×
181
    }
182

183
    public Builder options(List<MetadataTemplateFieldsOptionsField> options) {
UNCOV
184
      this.options = options;
×
185
      return this;
×
186
    }
187

188
    public Builder id(String id) {
189
      this.id = id;
×
190
      return this;
×
191
    }
192

193
    public MetadataTemplateFieldsField build() {
194
      return new MetadataTemplateFieldsField(this);
×
195
    }
196
  }
197
}
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