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

box / box-java-sdk / #5076

07 Oct 2025 12:35PM UTC coverage: 37.132% (+0.007%) from 37.125%
#5076

push

github

web-flow
test: Change `Event.additionalDetails` field assertion in events test (box/box-codegen#858) (#1491)

18454 of 49699 relevant lines covered (37.13%)

0.37 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.Nullable;
4
import com.box.sdkgen.internal.NullableFieldTracker;
5
import com.box.sdkgen.internal.SerializableObject;
6
import com.box.sdkgen.serialization.json.EnumWrapper;
7
import com.fasterxml.jackson.annotation.JsonFilter;
8
import com.fasterxml.jackson.annotation.JsonProperty;
9
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
10
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
11
import java.util.Map;
12
import java.util.Objects;
13

14
/** A generic error. */
15
@JsonFilter("nullablePropertyFilter")
16
public class ClientError extends SerializableObject {
17

18
  /** The value will always be `error`. */
19
  @JsonDeserialize(using = ClientErrorTypeField.ClientErrorTypeFieldDeserializer.class)
20
  @JsonSerialize(using = ClientErrorTypeField.ClientErrorTypeFieldSerializer.class)
21
  protected EnumWrapper<ClientErrorTypeField> type;
22

23
  /** The HTTP status of the response. */
24
  protected Integer status;
25

26
  /** A Box-specific error code. */
27
  @JsonDeserialize(using = ClientErrorCodeField.ClientErrorCodeFieldDeserializer.class)
28
  @JsonSerialize(using = ClientErrorCodeField.ClientErrorCodeFieldSerializer.class)
29
  protected EnumWrapper<ClientErrorCodeField> code;
30

31
  /** A short message describing the error. */
32
  protected String message;
33

34
  /**
35
   * A free-form object that contains additional context about the error. The possible fields are
36
   * defined on a per-endpoint basis. `message` is only one example.
37
   */
38
  @JsonProperty("context_info")
39
  @Nullable
40
  protected Map<String, Object> contextInfo;
41

42
  /** A URL that links to more information about why this error occurred. */
43
  @JsonProperty("help_url")
44
  protected String helpUrl;
45

46
  /** A unique identifier for this response, which can be used when contacting Box support. */
47
  @JsonProperty("request_id")
48
  protected String requestId;
49

50
  public ClientError() {
51
    super();
×
52
  }
×
53

54
  protected ClientError(Builder builder) {
55
    super();
×
56
    this.type = builder.type;
×
57
    this.status = builder.status;
×
58
    this.code = builder.code;
×
59
    this.message = builder.message;
×
60
    this.contextInfo = builder.contextInfo;
×
61
    this.helpUrl = builder.helpUrl;
×
62
    this.requestId = builder.requestId;
×
63
    markNullableFieldsAsSet(builder.getExplicitlySetNullableFields());
×
64
  }
×
65

66
  public EnumWrapper<ClientErrorTypeField> getType() {
67
    return type;
×
68
  }
69

70
  public Integer getStatus() {
71
    return status;
×
72
  }
73

74
  public EnumWrapper<ClientErrorCodeField> getCode() {
75
    return code;
×
76
  }
77

78
  public String getMessage() {
79
    return message;
×
80
  }
81

82
  public Map<String, Object> getContextInfo() {
83
    return contextInfo;
×
84
  }
85

86
  public String getHelpUrl() {
87
    return helpUrl;
×
88
  }
89

90
  public String getRequestId() {
91
    return requestId;
×
92
  }
93

94
  @Override
95
  public boolean equals(Object o) {
96
    if (this == o) {
×
97
      return true;
×
98
    }
99
    if (o == null || getClass() != o.getClass()) {
×
100
      return false;
×
101
    }
102
    ClientError casted = (ClientError) o;
×
103
    return Objects.equals(type, casted.type)
×
104
        && Objects.equals(status, casted.status)
×
105
        && Objects.equals(code, casted.code)
×
106
        && Objects.equals(message, casted.message)
×
107
        && Objects.equals(contextInfo, casted.contextInfo)
×
108
        && Objects.equals(helpUrl, casted.helpUrl)
×
109
        && Objects.equals(requestId, casted.requestId);
×
110
  }
111

112
  @Override
113
  public int hashCode() {
114
    return Objects.hash(type, status, code, message, contextInfo, helpUrl, requestId);
×
115
  }
116

117
  @Override
118
  public String toString() {
119
    return "ClientError{"
×
120
        + "type='"
121
        + type
122
        + '\''
123
        + ", "
124
        + "status='"
125
        + status
126
        + '\''
127
        + ", "
128
        + "code='"
129
        + code
130
        + '\''
131
        + ", "
132
        + "message='"
133
        + message
134
        + '\''
135
        + ", "
136
        + "contextInfo='"
137
        + contextInfo
138
        + '\''
139
        + ", "
140
        + "helpUrl='"
141
        + helpUrl
142
        + '\''
143
        + ", "
144
        + "requestId='"
145
        + requestId
146
        + '\''
147
        + "}";
148
  }
149

150
  public static class Builder extends NullableFieldTracker {
×
151

152
    protected EnumWrapper<ClientErrorTypeField> type;
153

154
    protected Integer status;
155

156
    protected EnumWrapper<ClientErrorCodeField> code;
157

158
    protected String message;
159

160
    protected Map<String, Object> contextInfo;
161

162
    protected String helpUrl;
163

164
    protected String requestId;
165

166
    public Builder type(ClientErrorTypeField type) {
167
      this.type = new EnumWrapper<ClientErrorTypeField>(type);
×
168
      return this;
×
169
    }
170

171
    public Builder type(EnumWrapper<ClientErrorTypeField> type) {
172
      this.type = type;
×
173
      return this;
×
174
    }
175

176
    public Builder status(Integer status) {
177
      this.status = status;
×
178
      return this;
×
179
    }
180

181
    public Builder code(ClientErrorCodeField code) {
182
      this.code = new EnumWrapper<ClientErrorCodeField>(code);
×
183
      return this;
×
184
    }
185

186
    public Builder code(EnumWrapper<ClientErrorCodeField> code) {
187
      this.code = code;
×
188
      return this;
×
189
    }
190

191
    public Builder message(String message) {
192
      this.message = message;
×
193
      return this;
×
194
    }
195

196
    public Builder contextInfo(Map<String, Object> contextInfo) {
197
      this.contextInfo = contextInfo;
×
198
      this.markNullableFieldAsSet("context_info");
×
199
      return this;
×
200
    }
201

202
    public Builder helpUrl(String helpUrl) {
203
      this.helpUrl = helpUrl;
×
204
      return this;
×
205
    }
206

207
    public Builder requestId(String requestId) {
208
      this.requestId = requestId;
×
209
      return this;
×
210
    }
211

212
    public ClientError build() {
213
      return new ClientError(this);
×
214
    }
215
  }
216
}
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