• 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

13.73
/src/main/java/com/box/sdkgen/schemas/uploadsession/UploadSession.java
1
package com.box.sdkgen.schemas.uploadsession;
2

3
import com.box.sdkgen.internal.NullableFieldTracker;
4
import com.box.sdkgen.internal.SerializableObject;
5
import com.box.sdkgen.internal.utils.DateTimeUtils;
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.time.OffsetDateTime;
12
import java.util.Objects;
13

14
/** An upload session for chunk uploading a file. */
15
@JsonFilter("nullablePropertyFilter")
16
public class UploadSession extends SerializableObject {
17

18
  /** The unique identifier for this session. */
19
  protected String id;
20

21
  /** The value will always be `upload_session`. */
22
  @JsonDeserialize(using = UploadSessionTypeField.UploadSessionTypeFieldDeserializer.class)
23
  @JsonSerialize(using = UploadSessionTypeField.UploadSessionTypeFieldSerializer.class)
24
  protected EnumWrapper<UploadSessionTypeField> type;
25

26
  /** The date and time when this session expires. */
27
  @JsonProperty("session_expires_at")
28
  @JsonSerialize(using = DateTimeUtils.DateTimeSerializer.class)
29
  @JsonDeserialize(using = DateTimeUtils.DateTimeDeserializer.class)
30
  protected OffsetDateTime sessionExpiresAt;
31

32
  /**
33
   * The size in bytes that must be used for all parts of of the upload.
34
   *
35
   * <p>Only the last part is allowed to be of a smaller size.
36
   */
37
  @JsonProperty("part_size")
38
  protected Long partSize;
39

40
  /**
41
   * The total number of parts expected in this upload session, as determined by the file size and
42
   * part size.
43
   */
44
  @JsonProperty("total_parts")
45
  protected Integer totalParts;
46

47
  /**
48
   * The number of parts that have been uploaded and processed by the server. This starts at `0`.
49
   *
50
   * <p>When committing a file files, inspecting this property can provide insight if all parts have
51
   * been uploaded correctly.
52
   */
53
  @JsonProperty("num_parts_processed")
54
  protected Integer numPartsProcessed;
55

56
  @JsonProperty("session_endpoints")
57
  protected UploadSessionSessionEndpointsField sessionEndpoints;
58

59
  public UploadSession() {
60
    super();
1✔
61
  }
1✔
62

63
  protected UploadSession(Builder builder) {
64
    super();
×
65
    this.id = builder.id;
×
66
    this.type = builder.type;
×
67
    this.sessionExpiresAt = builder.sessionExpiresAt;
×
68
    this.partSize = builder.partSize;
×
69
    this.totalParts = builder.totalParts;
×
70
    this.numPartsProcessed = builder.numPartsProcessed;
×
71
    this.sessionEndpoints = builder.sessionEndpoints;
×
72
    markNullableFieldsAsSet(builder.getExplicitlySetNullableFields());
×
73
  }
×
74

75
  public String getId() {
76
    return id;
1✔
77
  }
78

79
  public EnumWrapper<UploadSessionTypeField> getType() {
80
    return type;
×
81
  }
82

83
  public OffsetDateTime getSessionExpiresAt() {
84
    return sessionExpiresAt;
×
85
  }
86

87
  public Long getPartSize() {
88
    return partSize;
1✔
89
  }
90

91
  public Integer getTotalParts() {
92
    return totalParts;
1✔
93
  }
94

95
  public Integer getNumPartsProcessed() {
96
    return numPartsProcessed;
1✔
97
  }
98

99
  public UploadSessionSessionEndpointsField getSessionEndpoints() {
100
    return sessionEndpoints;
1✔
101
  }
102

103
  @Override
104
  public boolean equals(Object o) {
105
    if (this == o) {
×
106
      return true;
×
107
    }
108
    if (o == null || getClass() != o.getClass()) {
×
109
      return false;
×
110
    }
111
    UploadSession casted = (UploadSession) o;
×
112
    return Objects.equals(id, casted.id)
×
113
        && Objects.equals(type, casted.type)
×
114
        && Objects.equals(sessionExpiresAt, casted.sessionExpiresAt)
×
115
        && Objects.equals(partSize, casted.partSize)
×
116
        && Objects.equals(totalParts, casted.totalParts)
×
117
        && Objects.equals(numPartsProcessed, casted.numPartsProcessed)
×
118
        && Objects.equals(sessionEndpoints, casted.sessionEndpoints);
×
119
  }
120

121
  @Override
122
  public int hashCode() {
123
    return Objects.hash(
×
124
        id, type, sessionExpiresAt, partSize, totalParts, numPartsProcessed, sessionEndpoints);
125
  }
126

127
  @Override
128
  public String toString() {
129
    return "UploadSession{"
×
130
        + "id='"
131
        + id
132
        + '\''
133
        + ", "
134
        + "type='"
135
        + type
136
        + '\''
137
        + ", "
138
        + "sessionExpiresAt='"
139
        + sessionExpiresAt
140
        + '\''
141
        + ", "
142
        + "partSize='"
143
        + partSize
144
        + '\''
145
        + ", "
146
        + "totalParts='"
147
        + totalParts
148
        + '\''
149
        + ", "
150
        + "numPartsProcessed='"
151
        + numPartsProcessed
152
        + '\''
153
        + ", "
154
        + "sessionEndpoints='"
155
        + sessionEndpoints
156
        + '\''
157
        + "}";
158
  }
159

160
  public static class Builder extends NullableFieldTracker {
×
161

162
    protected String id;
163

164
    protected EnumWrapper<UploadSessionTypeField> type;
165

166
    protected OffsetDateTime sessionExpiresAt;
167

168
    protected Long partSize;
169

170
    protected Integer totalParts;
171

172
    protected Integer numPartsProcessed;
173

174
    protected UploadSessionSessionEndpointsField sessionEndpoints;
175

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

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

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

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

196
    public Builder partSize(Long partSize) {
197
      this.partSize = partSize;
×
198
      return this;
×
199
    }
200

201
    public Builder totalParts(Integer totalParts) {
202
      this.totalParts = totalParts;
×
203
      return this;
×
204
    }
205

206
    public Builder numPartsProcessed(Integer numPartsProcessed) {
207
      this.numPartsProcessed = numPartsProcessed;
×
208
      return this;
×
209
    }
210

211
    public Builder sessionEndpoints(UploadSessionSessionEndpointsField sessionEndpoints) {
212
      this.sessionEndpoints = sessionEndpoints;
×
213
      return this;
×
214
    }
215

216
    public UploadSession build() {
217
      return new UploadSession(this);
×
218
    }
219
  }
220
}
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