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

box / box-java-sdk / #6241

10 Feb 2026 05:27PM UTC coverage: 24.324% (+11.5%) from 12.84%
#6241

push

github

web-flow
fix(boxsdkgen): Move assigning default values from builder constructor to `build()` method (box/box-codegen#922) (#1712)

0 of 1677 new or added lines in 569 files covered. (0.0%)

2130 existing lines in 537 files now uncovered.

7388 of 30373 relevant lines covered (24.32%)

0.28 hits per line

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

0.0
/src/main/java/com/box/sdkgen/networking/fetchoptions/FetchOptions.java
1
package com.box.sdkgen.networking.fetchoptions;
2

3
import com.box.sdkgen.networking.auth.Authentication;
4
import com.box.sdkgen.networking.network.NetworkSession;
5
import com.box.sdkgen.serialization.json.EnumWrapper;
6
import com.fasterxml.jackson.databind.JsonNode;
7
import java.io.InputStream;
8
import java.util.List;
9
import java.util.Map;
10

11
public class FetchOptions {
12

13
  /** URL of the request */
14
  public final String url;
15

16
  /** HTTP verb of the request */
17
  public final String method;
18

19
  /** HTTP query parameters */
20
  public Map<String, String> params;
21

22
  /** HTTP headers */
23
  public Map<String, String> headers;
24

25
  /** Request body of the request */
26
  public JsonNode data;
27

28
  /** Stream data of the request */
29
  public InputStream fileStream;
30

31
  /** Multipart data of the request */
32
  public List<MultipartItem> multipartData;
33

34
  /** Content type of the request body */
35
  public String contentType;
36

37
  /** Expected response format */
38
  public EnumWrapper<ResponseFormat> responseFormat;
39

40
  /** Authentication object */
41
  public Authentication auth;
42

43
  /** Network session object */
44
  public NetworkSession networkSession;
45

46
  /**
47
   * A boolean value indicate if the request should follow redirects. Defaults to True. Not
48
   * supported in Browser environment.
49
   */
50
  public Boolean followRedirects;
51

52
  public FetchOptions(String url, String method) {
×
53
    this.url = url;
×
54
    this.method = method;
×
55
    this.contentType = "application/json";
×
56
    this.responseFormat = new EnumWrapper<ResponseFormat>(ResponseFormat.JSON);
×
57
    this.followRedirects = true;
×
58
  }
×
59

60
  protected FetchOptions(Builder builder) {
×
61
    this.url = builder.url;
×
62
    this.method = builder.method;
×
63
    this.params = builder.params;
×
64
    this.headers = builder.headers;
×
65
    this.data = builder.data;
×
66
    this.fileStream = builder.fileStream;
×
67
    this.multipartData = builder.multipartData;
×
68
    this.contentType = builder.contentType;
×
69
    this.responseFormat = builder.responseFormat;
×
70
    this.auth = builder.auth;
×
71
    this.networkSession = builder.networkSession;
×
72
    this.followRedirects = builder.followRedirects;
×
73
  }
×
74

75
  public String getUrl() {
76
    return url;
×
77
  }
78

79
  public String getMethod() {
80
    return method;
×
81
  }
82

83
  public Map<String, String> getParams() {
84
    return params;
×
85
  }
86

87
  public Map<String, String> getHeaders() {
88
    return headers;
×
89
  }
90

91
  public JsonNode getData() {
92
    return data;
×
93
  }
94

95
  public InputStream getFileStream() {
96
    return fileStream;
×
97
  }
98

99
  public List<MultipartItem> getMultipartData() {
100
    return multipartData;
×
101
  }
102

103
  public String getContentType() {
104
    return contentType;
×
105
  }
106

107
  public EnumWrapper<ResponseFormat> getResponseFormat() {
108
    return responseFormat;
×
109
  }
110

111
  public Authentication getAuth() {
112
    return auth;
×
113
  }
114

115
  public NetworkSession getNetworkSession() {
116
    return networkSession;
×
117
  }
118

119
  public Boolean getFollowRedirects() {
120
    return followRedirects;
×
121
  }
122

123
  public static class Builder {
124

125
    protected final String url;
126

127
    protected final String method;
128

129
    protected Map<String, String> params;
130

131
    protected Map<String, String> headers;
132

133
    protected JsonNode data;
134

135
    protected InputStream fileStream;
136

137
    protected List<MultipartItem> multipartData;
138

139
    protected String contentType;
140

141
    protected EnumWrapper<ResponseFormat> responseFormat;
142

143
    protected Authentication auth;
144

145
    protected NetworkSession networkSession;
146

147
    protected Boolean followRedirects;
148

149
    public Builder(String url, String method) {
×
150
      this.url = url;
×
151
      this.method = method;
×
152
    }
×
153

154
    public Builder params(Map<String, String> params) {
UNCOV
155
      this.params = params;
×
UNCOV
156
      return this;
×
157
    }
158

159
    public Builder headers(Map<String, String> headers) {
UNCOV
160
      this.headers = headers;
×
UNCOV
161
      return this;
×
162
    }
163

164
    public Builder data(JsonNode data) {
UNCOV
165
      this.data = data;
×
UNCOV
166
      return this;
×
167
    }
168

169
    public Builder fileStream(InputStream fileStream) {
UNCOV
170
      this.fileStream = fileStream;
×
UNCOV
171
      return this;
×
172
    }
173

174
    public Builder multipartData(List<MultipartItem> multipartData) {
UNCOV
175
      this.multipartData = multipartData;
×
UNCOV
176
      return this;
×
177
    }
178

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

184
    public Builder responseFormat(ResponseFormat responseFormat) {
UNCOV
185
      this.responseFormat = new EnumWrapper<ResponseFormat>(responseFormat);
×
UNCOV
186
      return this;
×
187
    }
188

189
    public Builder responseFormat(EnumWrapper<ResponseFormat> responseFormat) {
UNCOV
190
      this.responseFormat = responseFormat;
×
UNCOV
191
      return this;
×
192
    }
193

194
    public Builder auth(Authentication auth) {
UNCOV
195
      this.auth = auth;
×
UNCOV
196
      return this;
×
197
    }
198

199
    public Builder networkSession(NetworkSession networkSession) {
UNCOV
200
      this.networkSession = networkSession;
×
UNCOV
201
      return this;
×
202
    }
203

204
    public Builder followRedirects(Boolean followRedirects) {
UNCOV
205
      this.followRedirects = followRedirects;
×
UNCOV
206
      return this;
×
207
    }
208

209
    public FetchOptions build() {
NEW
210
      if (this.contentType == null) {
×
NEW
211
        this.contentType = "application/json";
×
212
      }
NEW
213
      if (this.responseFormat == null) {
×
NEW
214
        this.responseFormat = new EnumWrapper<ResponseFormat>(ResponseFormat.JSON);
×
215
      }
NEW
216
      if (this.followRedirects == null) {
×
NEW
217
        this.followRedirects = true;
×
218
      }
219
      return new FetchOptions(this);
×
220
    }
221
  }
222
}
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