• 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

15.52
/src/main/java/com/box/sdkgen/schemas/metadatatemplate/MetadataTemplate.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 MetadataTemplate extends SerializableObject {
12

13
  protected final String id;
14

15
  @JsonDeserialize(using = MetadataTemplateTypeField.MetadataTemplateTypeFieldDeserializer.class)
16
  @JsonSerialize(using = MetadataTemplateTypeField.MetadataTemplateTypeFieldSerializer.class)
17
  protected EnumWrapper<MetadataTemplateTypeField> type;
18

19
  protected String scope;
20

21
  protected String templateKey;
22

23
  protected String displayName;
24

25
  protected Boolean hidden;
26

27
  protected List<MetadataTemplateFieldsField> fields;
28

29
  protected Boolean copyInstanceOnItemCopy;
30

31
  public MetadataTemplate(@JsonProperty("id") String id) {
32
    super();
1✔
33
    this.id = id;
1✔
34
    this.type =
1✔
35
        new EnumWrapper<MetadataTemplateTypeField>(MetadataTemplateTypeField.METADATA_TEMPLATE);
36
  }
1✔
37

38
  protected MetadataTemplate(Builder builder) {
39
    super();
×
40
    this.id = builder.id;
×
41
    this.type = builder.type;
×
42
    this.scope = builder.scope;
×
43
    this.templateKey = builder.templateKey;
×
44
    this.displayName = builder.displayName;
×
45
    this.hidden = builder.hidden;
×
46
    this.fields = builder.fields;
×
47
    this.copyInstanceOnItemCopy = builder.copyInstanceOnItemCopy;
×
48
  }
×
49

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

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

58
  public String getScope() {
59
    return scope;
1✔
60
  }
61

62
  public String getTemplateKey() {
63
    return templateKey;
1✔
64
  }
65

66
  public String getDisplayName() {
67
    return displayName;
1✔
68
  }
69

70
  public Boolean getHidden() {
71
    return hidden;
×
72
  }
73

74
  public List<MetadataTemplateFieldsField> getFields() {
75
    return fields;
1✔
76
  }
77

78
  public Boolean getCopyInstanceOnItemCopy() {
79
    return copyInstanceOnItemCopy;
×
80
  }
81

82
  @Override
83
  public boolean equals(Object o) {
84
    if (this == o) {
×
85
      return true;
×
86
    }
87
    if (o == null || getClass() != o.getClass()) {
×
88
      return false;
×
89
    }
90
    MetadataTemplate casted = (MetadataTemplate) o;
×
91
    return Objects.equals(id, casted.id)
×
92
        && Objects.equals(type, casted.type)
×
93
        && Objects.equals(scope, casted.scope)
×
94
        && Objects.equals(templateKey, casted.templateKey)
×
95
        && Objects.equals(displayName, casted.displayName)
×
96
        && Objects.equals(hidden, casted.hidden)
×
97
        && Objects.equals(fields, casted.fields)
×
98
        && Objects.equals(copyInstanceOnItemCopy, casted.copyInstanceOnItemCopy);
×
99
  }
100

101
  @Override
102
  public int hashCode() {
103
    return Objects.hash(
×
104
        id, type, scope, templateKey, displayName, hidden, fields, copyInstanceOnItemCopy);
105
  }
106

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

144
  public static class Builder {
145

146
    protected final String id;
147

148
    protected EnumWrapper<MetadataTemplateTypeField> type;
149

150
    protected String scope;
151

152
    protected String templateKey;
153

154
    protected String displayName;
155

156
    protected Boolean hidden;
157

158
    protected List<MetadataTemplateFieldsField> fields;
159

160
    protected Boolean copyInstanceOnItemCopy;
161

NEW
162
    public Builder(String id) {
×
163
      this.id = id;
×
164
      this.type =
×
165
          new EnumWrapper<MetadataTemplateTypeField>(MetadataTemplateTypeField.METADATA_TEMPLATE);
166
    }
×
167

168
    public Builder type(MetadataTemplateTypeField type) {
169
      this.type = new EnumWrapper<MetadataTemplateTypeField>(type);
×
170
      return this;
×
171
    }
172

173
    public Builder type(EnumWrapper<MetadataTemplateTypeField> type) {
174
      this.type = type;
×
175
      return this;
×
176
    }
177

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

183
    public Builder templateKey(String templateKey) {
184
      this.templateKey = templateKey;
×
185
      return this;
×
186
    }
187

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

193
    public Builder hidden(Boolean hidden) {
194
      this.hidden = hidden;
×
195
      return this;
×
196
    }
197

198
    public Builder fields(List<MetadataTemplateFieldsField> fields) {
199
      this.fields = fields;
×
200
      return this;
×
201
    }
202

203
    public Builder copyInstanceOnItemCopy(Boolean copyInstanceOnItemCopy) {
204
      this.copyInstanceOnItemCopy = copyInstanceOnItemCopy;
×
205
      return this;
×
206
    }
207

208
    public MetadataTemplate build() {
209
      return new MetadataTemplate(this);
×
210
    }
211
  }
212
}
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