• 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

9.8
/src/main/java/com/box/sdkgen/schemas/comment/Comment.java
1
package com.box.sdkgen.schemas.comment;
2

3
import com.box.sdkgen.internal.utils.DateTimeUtils;
4
import com.box.sdkgen.schemas.commentbase.CommentBase;
5
import com.box.sdkgen.schemas.commentbase.CommentBaseTypeField;
6
import com.box.sdkgen.schemas.usermini.UserMini;
7
import com.box.sdkgen.serialization.json.EnumWrapper;
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.Date;
12
import java.util.Objects;
13

14
public class Comment extends CommentBase {
15

16
  @JsonProperty("is_reply_comment")
17
  protected Boolean isReplyComment;
18

19
  protected String message;
20

21
  @JsonProperty("created_by")
22
  protected UserMini createdBy;
23

24
  @JsonProperty("created_at")
25
  @JsonSerialize(using = DateTimeUtils.DateTimeSerializer.class)
26
  @JsonDeserialize(using = DateTimeUtils.DateTimeDeserializer.class)
27
  protected Date createdAt;
28

29
  @JsonProperty("modified_at")
30
  @JsonSerialize(using = DateTimeUtils.DateTimeSerializer.class)
31
  @JsonDeserialize(using = DateTimeUtils.DateTimeDeserializer.class)
32
  protected Date modifiedAt;
33

34
  protected CommentItemField item;
35

36
  public Comment() {
37
    super();
1✔
38
  }
1✔
39

40
  protected Comment(Builder builder) {
41
    super(builder);
×
42
    this.isReplyComment = builder.isReplyComment;
×
43
    this.message = builder.message;
×
44
    this.createdBy = builder.createdBy;
×
45
    this.createdAt = builder.createdAt;
×
46
    this.modifiedAt = builder.modifiedAt;
×
47
    this.item = builder.item;
×
48
  }
×
49

50
  public Boolean getIsReplyComment() {
51
    return isReplyComment;
1✔
52
  }
53

54
  public String getMessage() {
55
    return message;
1✔
56
  }
57

58
  public UserMini getCreatedBy() {
59
    return createdBy;
×
60
  }
61

62
  public Date getCreatedAt() {
63
    return createdAt;
×
64
  }
65

66
  public Date getModifiedAt() {
67
    return modifiedAt;
×
68
  }
69

70
  public CommentItemField getItem() {
71
    return item;
1✔
72
  }
73

74
  @Override
75
  public boolean equals(Object o) {
76
    if (this == o) {
×
77
      return true;
×
78
    }
79
    if (o == null || getClass() != o.getClass()) {
×
80
      return false;
×
81
    }
82
    Comment casted = (Comment) o;
×
83
    return Objects.equals(id, casted.id)
×
84
        && Objects.equals(type, casted.type)
×
85
        && Objects.equals(isReplyComment, casted.isReplyComment)
×
86
        && Objects.equals(message, casted.message)
×
87
        && Objects.equals(createdBy, casted.createdBy)
×
88
        && Objects.equals(createdAt, casted.createdAt)
×
89
        && Objects.equals(modifiedAt, casted.modifiedAt)
×
90
        && Objects.equals(item, casted.item);
×
91
  }
92

93
  @Override
94
  public int hashCode() {
95
    return Objects.hash(id, type, isReplyComment, message, createdBy, createdAt, modifiedAt, item);
×
96
  }
97

98
  @Override
99
  public String toString() {
100
    return "Comment{"
×
101
        + "id='"
102
        + id
103
        + '\''
104
        + ", "
105
        + "type='"
106
        + type
107
        + '\''
108
        + ", "
109
        + "isReplyComment='"
110
        + isReplyComment
111
        + '\''
112
        + ", "
113
        + "message='"
114
        + message
115
        + '\''
116
        + ", "
117
        + "createdBy='"
118
        + createdBy
119
        + '\''
120
        + ", "
121
        + "createdAt='"
122
        + createdAt
123
        + '\''
124
        + ", "
125
        + "modifiedAt='"
126
        + modifiedAt
127
        + '\''
128
        + ", "
129
        + "item='"
130
        + item
131
        + '\''
132
        + "}";
133
  }
134

NEW
135
  public static class Builder extends CommentBase.Builder {
×
136

137
    protected Boolean isReplyComment;
138

139
    protected String message;
140

141
    protected UserMini createdBy;
142

143
    protected Date createdAt;
144

145
    protected Date modifiedAt;
146

147
    protected CommentItemField item;
148

149
    public Builder isReplyComment(Boolean isReplyComment) {
150
      this.isReplyComment = isReplyComment;
×
151
      return this;
×
152
    }
153

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

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

164
    public Builder createdAt(Date createdAt) {
165
      this.createdAt = createdAt;
×
166
      return this;
×
167
    }
168

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

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

179
    @Override
180
    public Builder id(String id) {
181
      this.id = id;
×
182
      return this;
×
183
    }
184

185
    @Override
186
    public Builder type(CommentBaseTypeField type) {
187
      this.type = new EnumWrapper<CommentBaseTypeField>(type);
×
188
      return this;
×
189
    }
190

191
    @Override
192
    public Builder type(EnumWrapper<CommentBaseTypeField> type) {
193
      this.type = type;
×
194
      return this;
×
195
    }
196

197
    public Comment build() {
198
      return new Comment(this);
×
199
    }
200
  }
201
}
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