• 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

0.0
/src/main/java/com/box/sdkgen/schemas/clienterror/ClientError.java
1
package com.box.sdkgen.schemas.clienterror;
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.Map;
9
import java.util.Objects;
10

11
public class ClientError extends SerializableObject {
12

13
  @JsonDeserialize(using = ClientErrorTypeField.ClientErrorTypeFieldDeserializer.class)
14
  @JsonSerialize(using = ClientErrorTypeField.ClientErrorTypeFieldSerializer.class)
15
  protected EnumWrapper<ClientErrorTypeField> type;
16

17
  protected Integer status;
18

19
  @JsonDeserialize(using = ClientErrorCodeField.ClientErrorCodeFieldDeserializer.class)
20
  @JsonSerialize(using = ClientErrorCodeField.ClientErrorCodeFieldSerializer.class)
21
  protected EnumWrapper<ClientErrorCodeField> code;
22

23
  protected String message;
24

25
  @JsonProperty("context_info")
26
  protected Map<String, Object> contextInfo;
27

28
  @JsonProperty("help_url")
29
  protected String helpUrl;
30

31
  @JsonProperty("request_id")
32
  protected String requestId;
33

34
  public ClientError() {
35
    super();
×
36
  }
×
37

38
  protected ClientError(Builder builder) {
39
    super();
×
40
    this.type = builder.type;
×
41
    this.status = builder.status;
×
42
    this.code = builder.code;
×
43
    this.message = builder.message;
×
44
    this.contextInfo = builder.contextInfo;
×
45
    this.helpUrl = builder.helpUrl;
×
46
    this.requestId = builder.requestId;
×
47
  }
×
48

49
  public EnumWrapper<ClientErrorTypeField> getType() {
50
    return type;
×
51
  }
52

53
  public Integer getStatus() {
54
    return status;
×
55
  }
56

57
  public EnumWrapper<ClientErrorCodeField> getCode() {
58
    return code;
×
59
  }
60

61
  public String getMessage() {
62
    return message;
×
63
  }
64

65
  public Map<String, Object> getContextInfo() {
66
    return contextInfo;
×
67
  }
68

69
  public String getHelpUrl() {
70
    return helpUrl;
×
71
  }
72

73
  public String getRequestId() {
74
    return requestId;
×
75
  }
76

77
  @Override
78
  public boolean equals(Object o) {
79
    if (this == o) {
×
80
      return true;
×
81
    }
82
    if (o == null || getClass() != o.getClass()) {
×
83
      return false;
×
84
    }
85
    ClientError casted = (ClientError) o;
×
86
    return Objects.equals(type, casted.type)
×
87
        && Objects.equals(status, casted.status)
×
88
        && Objects.equals(code, casted.code)
×
89
        && Objects.equals(message, casted.message)
×
90
        && Objects.equals(contextInfo, casted.contextInfo)
×
91
        && Objects.equals(helpUrl, casted.helpUrl)
×
92
        && Objects.equals(requestId, casted.requestId);
×
93
  }
94

95
  @Override
96
  public int hashCode() {
97
    return Objects.hash(type, status, code, message, contextInfo, helpUrl, requestId);
×
98
  }
99

100
  @Override
101
  public String toString() {
102
    return "ClientError{"
×
103
        + "type='"
104
        + type
105
        + '\''
106
        + ", "
107
        + "status='"
108
        + status
109
        + '\''
110
        + ", "
111
        + "code='"
112
        + code
113
        + '\''
114
        + ", "
115
        + "message='"
116
        + message
117
        + '\''
118
        + ", "
119
        + "contextInfo='"
120
        + contextInfo
121
        + '\''
122
        + ", "
123
        + "helpUrl='"
124
        + helpUrl
125
        + '\''
126
        + ", "
127
        + "requestId='"
128
        + requestId
129
        + '\''
130
        + "}";
131
  }
132

NEW
133
  public static class Builder {
×
134

135
    protected EnumWrapper<ClientErrorTypeField> type;
136

137
    protected Integer status;
138

139
    protected EnumWrapper<ClientErrorCodeField> code;
140

141
    protected String message;
142

143
    protected Map<String, Object> contextInfo;
144

145
    protected String helpUrl;
146

147
    protected String requestId;
148

149
    public Builder type(ClientErrorTypeField type) {
150
      this.type = new EnumWrapper<ClientErrorTypeField>(type);
×
151
      return this;
×
152
    }
153

154
    public Builder type(EnumWrapper<ClientErrorTypeField> type) {
155
      this.type = type;
×
156
      return this;
×
157
    }
158

159
    public Builder status(Integer status) {
160
      this.status = status;
×
161
      return this;
×
162
    }
163

164
    public Builder code(ClientErrorCodeField code) {
165
      this.code = new EnumWrapper<ClientErrorCodeField>(code);
×
166
      return this;
×
167
    }
168

169
    public Builder code(EnumWrapper<ClientErrorCodeField> code) {
170
      this.code = code;
×
171
      return this;
×
172
    }
173

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

179
    public Builder contextInfo(Map<String, Object> contextInfo) {
180
      this.contextInfo = contextInfo;
×
181
      return this;
×
182
    }
183

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

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

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