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

box / box-java-sdk-gen / #358

11 Jul 2025 04:43PM UTC coverage: 38.091% (+2.5%) from 35.58%
#358

Pull #361

github

web-flow
Merge 112b63b24 into 426763c84
Pull Request #361: feat: Support common fields in Union in Java (box/box-codegen#758)

288 of 1203 new or added lines in 106 files covered. (23.94%)

167 existing lines in 45 files now uncovered.

18543 of 48681 relevant lines covered (38.09%)

0.38 hits per line

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

14.29
/src/main/java/com/box/sdkgen/schemas/eventsource/EventSource.java
1
package com.box.sdkgen.schemas.eventsource;
2

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

15
@JsonFilter("nullablePropertyFilter")
16
public class EventSource extends SerializableObject {
17

18
  @JsonDeserialize(using = EventSourceItemTypeField.EventSourceItemTypeFieldDeserializer.class)
19
  @JsonSerialize(using = EventSourceItemTypeField.EventSourceItemTypeFieldSerializer.class)
20
  @JsonProperty("item_type")
21
  protected final EnumWrapper<EventSourceItemTypeField> itemType;
22

23
  @JsonProperty("item_id")
24
  protected final String itemId;
25

26
  @JsonProperty("item_name")
27
  protected final String itemName;
28

29
  protected EventSourceClassificationField classification;
30

31
  @Nullable protected FolderMini parent;
32

33
  @JsonProperty("owned_by")
34
  protected UserMini ownedBy;
35

36
  public EventSource(EventSourceItemTypeField itemType, String itemId, String itemName) {
UNCOV
37
    super();
×
NEW
38
    this.itemType = new EnumWrapper<EventSourceItemTypeField>(itemType);
×
UNCOV
39
    this.itemId = itemId;
×
UNCOV
40
    this.itemName = itemName;
×
UNCOV
41
  }
×
42

43
  public EventSource(
44
      @JsonProperty("item_type") EnumWrapper<EventSourceItemTypeField> itemType,
45
      @JsonProperty("item_id") String itemId,
46
      @JsonProperty("item_name") String itemName) {
47
    super();
1✔
48
    this.itemType = itemType;
1✔
49
    this.itemId = itemId;
1✔
50
    this.itemName = itemName;
1✔
51
  }
1✔
52

53
  protected EventSource(Builder builder) {
54
    super();
×
55
    this.itemType = builder.itemType;
×
56
    this.itemId = builder.itemId;
×
57
    this.itemName = builder.itemName;
×
58
    this.classification = builder.classification;
×
59
    this.parent = builder.parent;
×
60
    this.ownedBy = builder.ownedBy;
×
61
    markNullableFieldsAsSet(builder.getExplicitlySetNullableFields());
×
62
  }
×
63

64
  public EnumWrapper<EventSourceItemTypeField> getItemType() {
65
    return itemType;
1✔
66
  }
67

68
  public String getItemId() {
69
    return itemId;
1✔
70
  }
71

72
  public String getItemName() {
73
    return itemName;
1✔
74
  }
75

76
  public EventSourceClassificationField getClassification() {
77
    return classification;
×
78
  }
79

80
  public FolderMini getParent() {
81
    return parent;
×
82
  }
83

84
  public UserMini getOwnedBy() {
85
    return ownedBy;
×
86
  }
87

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

105
  @Override
106
  public int hashCode() {
107
    return Objects.hash(itemType, itemId, itemName, classification, parent, ownedBy);
×
108
  }
109

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

139
  public static class Builder extends NullableFieldTracker {
140

141
    protected final EnumWrapper<EventSourceItemTypeField> itemType;
142

143
    protected final String itemId;
144

145
    protected final String itemName;
146

147
    protected EventSourceClassificationField classification;
148

149
    protected FolderMini parent;
150

151
    protected UserMini ownedBy;
152

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

160
    public Builder(EnumWrapper<EventSourceItemTypeField> itemType, String itemId, String itemName) {
161
      super();
×
NEW
162
      this.itemType = itemType;
×
163
      this.itemId = itemId;
×
164
      this.itemName = itemName;
×
165
    }
×
166

167
    public Builder classification(EventSourceClassificationField classification) {
168
      this.classification = classification;
×
169
      return this;
×
170
    }
171

172
    public Builder parent(FolderMini parent) {
173
      this.parent = parent;
×
174
      this.markNullableFieldAsSet("parent");
×
175
      return this;
×
176
    }
177

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

183
    public EventSource build() {
184
      return new EventSource(this);
×
185
    }
186
  }
187
}
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