• 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.26
/src/main/java/com/box/sdkgen/schemas/eventsource/EventSource.java
1
package com.box.sdkgen.schemas.eventsource;
2

3
import com.box.sdkgen.internal.SerializableObject;
4
import com.box.sdkgen.schemas.foldermini.FolderMini;
5
import com.box.sdkgen.schemas.usermini.UserMini;
6
import com.box.sdkgen.serialization.json.EnumWrapper;
7
import com.fasterxml.jackson.annotation.JsonProperty;
8
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
9
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
10
import java.util.Objects;
11

12
public class EventSource extends SerializableObject {
13

14
  @JsonDeserialize(using = EventSourceItemTypeField.EventSourceItemTypeFieldDeserializer.class)
15
  @JsonSerialize(using = EventSourceItemTypeField.EventSourceItemTypeFieldSerializer.class)
16
  @JsonProperty("item_type")
17
  protected final EnumWrapper<EventSourceItemTypeField> itemType;
18

19
  @JsonProperty("item_id")
20
  protected final String itemId;
21

22
  @JsonProperty("item_name")
23
  protected final String itemName;
24

25
  protected EventSourceClassificationField classification;
26

27
  protected FolderMini parent;
28

29
  @JsonProperty("owned_by")
30
  protected UserMini ownedBy;
31

32
  public EventSource(
33
      @JsonProperty("item_type") EnumWrapper<EventSourceItemTypeField> itemType,
34
      @JsonProperty("item_id") String itemId,
35
      @JsonProperty("item_name") String itemName) {
36
    super();
1✔
37
    this.itemType = itemType;
1✔
38
    this.itemId = itemId;
1✔
39
    this.itemName = itemName;
1✔
40
  }
1✔
41

42
  public EventSource(EventSourceItemTypeField itemType, String itemId, String itemName) {
43
    super();
×
44
    this.itemType = new EnumWrapper<EventSourceItemTypeField>(itemType);
×
45
    this.itemId = itemId;
×
46
    this.itemName = itemName;
×
47
  }
×
48

49
  protected EventSource(Builder builder) {
50
    super();
×
51
    this.itemType = builder.itemType;
×
52
    this.itemId = builder.itemId;
×
53
    this.itemName = builder.itemName;
×
54
    this.classification = builder.classification;
×
55
    this.parent = builder.parent;
×
56
    this.ownedBy = builder.ownedBy;
×
57
  }
×
58

59
  public EnumWrapper<EventSourceItemTypeField> getItemType() {
60
    return itemType;
×
61
  }
62

63
  public String getItemId() {
64
    return itemId;
×
65
  }
66

67
  public String getItemName() {
68
    return itemName;
×
69
  }
70

71
  public EventSourceClassificationField getClassification() {
72
    return classification;
×
73
  }
74

75
  public FolderMini getParent() {
76
    return parent;
×
77
  }
78

79
  public UserMini getOwnedBy() {
80
    return ownedBy;
×
81
  }
82

83
  @Override
84
  public boolean equals(Object o) {
85
    if (this == o) {
×
86
      return true;
×
87
    }
88
    if (o == null || getClass() != o.getClass()) {
×
89
      return false;
×
90
    }
91
    EventSource casted = (EventSource) o;
×
92
    return Objects.equals(itemType, casted.itemType)
×
93
        && Objects.equals(itemId, casted.itemId)
×
94
        && Objects.equals(itemName, casted.itemName)
×
95
        && Objects.equals(classification, casted.classification)
×
96
        && Objects.equals(parent, casted.parent)
×
97
        && Objects.equals(ownedBy, casted.ownedBy);
×
98
  }
99

100
  @Override
101
  public int hashCode() {
102
    return Objects.hash(itemType, itemId, itemName, classification, parent, ownedBy);
×
103
  }
104

105
  @Override
106
  public String toString() {
107
    return "EventSource{"
×
108
        + "itemType='"
109
        + itemType
110
        + '\''
111
        + ", "
112
        + "itemId='"
113
        + itemId
114
        + '\''
115
        + ", "
116
        + "itemName='"
117
        + itemName
118
        + '\''
119
        + ", "
120
        + "classification='"
121
        + classification
122
        + '\''
123
        + ", "
124
        + "parent='"
125
        + parent
126
        + '\''
127
        + ", "
128
        + "ownedBy='"
129
        + ownedBy
130
        + '\''
131
        + "}";
132
  }
133

134
  public static class Builder {
135

136
    protected final EnumWrapper<EventSourceItemTypeField> itemType;
137

138
    protected final String itemId;
139

140
    protected final String itemName;
141

142
    protected EventSourceClassificationField classification;
143

144
    protected FolderMini parent;
145

146
    protected UserMini ownedBy;
147

NEW
148
    public Builder(EnumWrapper<EventSourceItemTypeField> itemType, String itemId, String itemName) {
×
149
      this.itemType = itemType;
×
150
      this.itemId = itemId;
×
151
      this.itemName = itemName;
×
152
    }
×
153

NEW
154
    public Builder(EventSourceItemTypeField itemType, String itemId, String itemName) {
×
155
      this.itemType = new EnumWrapper<EventSourceItemTypeField>(itemType);
×
156
      this.itemId = itemId;
×
157
      this.itemName = itemName;
×
158
    }
×
159

160
    public Builder classification(EventSourceClassificationField classification) {
161
      this.classification = classification;
×
162
      return this;
×
163
    }
164

165
    public Builder parent(FolderMini parent) {
166
      this.parent = parent;
×
167
      return this;
×
168
    }
169

170
    public Builder ownedBy(UserMini ownedBy) {
171
      this.ownedBy = ownedBy;
×
172
      return this;
×
173
    }
174

175
    public EventSource build() {
176
      return new EventSource(this);
×
177
    }
178
  }
179
}
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