• 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

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

3
import com.box.sdkgen.internal.SerializableObject;
4
import com.box.sdkgen.internal.utils.DateTimeUtils;
5
import com.box.sdkgen.serialization.json.EnumWrapper;
6
import com.fasterxml.jackson.annotation.JsonProperty;
7
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
8
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
9
import java.util.Date;
10
import java.util.Objects;
11

12
public class UploadSession extends SerializableObject {
13

14
  protected String id;
15

16
  @JsonDeserialize(using = UploadSessionTypeField.UploadSessionTypeFieldDeserializer.class)
17
  @JsonSerialize(using = UploadSessionTypeField.UploadSessionTypeFieldSerializer.class)
18
  protected EnumWrapper<UploadSessionTypeField> type;
19

20
  @JsonProperty("session_expires_at")
21
  @JsonSerialize(using = DateTimeUtils.DateTimeSerializer.class)
22
  @JsonDeserialize(using = DateTimeUtils.DateTimeDeserializer.class)
23
  protected Date sessionExpiresAt;
24

25
  @JsonProperty("part_size")
26
  protected Long partSize;
27

28
  @JsonProperty("total_parts")
29
  protected Integer totalParts;
30

31
  @JsonProperty("num_parts_processed")
32
  protected Integer numPartsProcessed;
33

34
  @JsonProperty("session_endpoints")
35
  protected UploadSessionSessionEndpointsField sessionEndpoints;
36

37
  public UploadSession() {
38
    super();
1✔
39
  }
1✔
40

41
  protected UploadSession(Builder builder) {
42
    super();
×
43
    this.id = builder.id;
×
44
    this.type = builder.type;
×
45
    this.sessionExpiresAt = builder.sessionExpiresAt;
×
46
    this.partSize = builder.partSize;
×
47
    this.totalParts = builder.totalParts;
×
48
    this.numPartsProcessed = builder.numPartsProcessed;
×
49
    this.sessionEndpoints = builder.sessionEndpoints;
×
50
  }
×
51

52
  public String getId() {
53
    return id;
1✔
54
  }
55

56
  public EnumWrapper<UploadSessionTypeField> getType() {
57
    return type;
×
58
  }
59

60
  public Date getSessionExpiresAt() {
61
    return sessionExpiresAt;
×
62
  }
63

64
  public Long getPartSize() {
65
    return partSize;
1✔
66
  }
67

68
  public Integer getTotalParts() {
69
    return totalParts;
1✔
70
  }
71

72
  public Integer getNumPartsProcessed() {
73
    return numPartsProcessed;
1✔
74
  }
75

76
  public UploadSessionSessionEndpointsField getSessionEndpoints() {
77
    return sessionEndpoints;
1✔
78
  }
79

80
  @Override
81
  public boolean equals(Object o) {
82
    if (this == o) {
×
83
      return true;
×
84
    }
85
    if (o == null || getClass() != o.getClass()) {
×
86
      return false;
×
87
    }
88
    UploadSession casted = (UploadSession) o;
×
89
    return Objects.equals(id, casted.id)
×
90
        && Objects.equals(type, casted.type)
×
91
        && Objects.equals(sessionExpiresAt, casted.sessionExpiresAt)
×
92
        && Objects.equals(partSize, casted.partSize)
×
93
        && Objects.equals(totalParts, casted.totalParts)
×
94
        && Objects.equals(numPartsProcessed, casted.numPartsProcessed)
×
95
        && Objects.equals(sessionEndpoints, casted.sessionEndpoints);
×
96
  }
97

98
  @Override
99
  public int hashCode() {
100
    return Objects.hash(
×
101
        id, type, sessionExpiresAt, partSize, totalParts, numPartsProcessed, sessionEndpoints);
102
  }
103

104
  @Override
105
  public String toString() {
106
    return "UploadSession{"
×
107
        + "id='"
108
        + id
109
        + '\''
110
        + ", "
111
        + "type='"
112
        + type
113
        + '\''
114
        + ", "
115
        + "sessionExpiresAt='"
116
        + sessionExpiresAt
117
        + '\''
118
        + ", "
119
        + "partSize='"
120
        + partSize
121
        + '\''
122
        + ", "
123
        + "totalParts='"
124
        + totalParts
125
        + '\''
126
        + ", "
127
        + "numPartsProcessed='"
128
        + numPartsProcessed
129
        + '\''
130
        + ", "
131
        + "sessionEndpoints='"
132
        + sessionEndpoints
133
        + '\''
134
        + "}";
135
  }
136

NEW
137
  public static class Builder {
×
138

139
    protected String id;
140

141
    protected EnumWrapper<UploadSessionTypeField> type;
142

143
    protected Date sessionExpiresAt;
144

145
    protected Long partSize;
146

147
    protected Integer totalParts;
148

149
    protected Integer numPartsProcessed;
150

151
    protected UploadSessionSessionEndpointsField sessionEndpoints;
152

153
    public Builder id(String id) {
154
      this.id = id;
×
155
      return this;
×
156
    }
157

158
    public Builder type(UploadSessionTypeField type) {
159
      this.type = new EnumWrapper<UploadSessionTypeField>(type);
×
160
      return this;
×
161
    }
162

163
    public Builder type(EnumWrapper<UploadSessionTypeField> type) {
164
      this.type = type;
×
165
      return this;
×
166
    }
167

168
    public Builder sessionExpiresAt(Date sessionExpiresAt) {
169
      this.sessionExpiresAt = sessionExpiresAt;
×
170
      return this;
×
171
    }
172

173
    public Builder partSize(Long partSize) {
174
      this.partSize = partSize;
×
175
      return this;
×
176
    }
177

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

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

188
    public Builder sessionEndpoints(UploadSessionSessionEndpointsField sessionEndpoints) {
UNCOV
189
      this.sessionEndpoints = sessionEndpoints;
×
190
      return this;
×
191
    }
192

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