• 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

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
/** The source file or folder that triggered an event in the event stream. */
16
@JsonFilter("nullablePropertyFilter")
17
public class EventSource extends SerializableObject {
18

19
  /** The type of the item that the event represents. Can be `file` or `folder`. */
20
  @JsonDeserialize(using = EventSourceItemTypeField.EventSourceItemTypeFieldDeserializer.class)
21
  @JsonSerialize(using = EventSourceItemTypeField.EventSourceItemTypeFieldSerializer.class)
22
  @JsonProperty("item_type")
23
  protected final EnumWrapper<EventSourceItemTypeField> itemType;
24

25
  /** The unique identifier that represents the item. */
26
  @JsonProperty("item_id")
27
  protected final String itemId;
28

29
  /** The name of the item. */
30
  @JsonProperty("item_name")
31
  protected final String itemName;
32

33
  /**
34
   * The object containing classification information for the item that triggered the event. This
35
   * field will not appear if the item does not have a classification set.
36
   */
37
  protected EventSourceClassificationField classification;
38

39
  @Nullable protected FolderMini parent;
40

41
  @JsonProperty("owned_by")
42
  protected UserMini ownedBy;
43

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

51
  public EventSource(
52
      @JsonProperty("item_type") EnumWrapper<EventSourceItemTypeField> itemType,
53
      @JsonProperty("item_id") String itemId,
54
      @JsonProperty("item_name") String itemName) {
55
    super();
1✔
56
    this.itemType = itemType;
1✔
57
    this.itemId = itemId;
1✔
58
    this.itemName = itemName;
1✔
59
  }
1✔
60

61
  protected EventSource(Builder builder) {
62
    super();
×
63
    this.itemType = builder.itemType;
×
64
    this.itemId = builder.itemId;
×
65
    this.itemName = builder.itemName;
×
66
    this.classification = builder.classification;
×
67
    this.parent = builder.parent;
×
68
    this.ownedBy = builder.ownedBy;
×
69
    markNullableFieldsAsSet(builder.getExplicitlySetNullableFields());
×
70
  }
×
71

72
  public EnumWrapper<EventSourceItemTypeField> getItemType() {
73
    return itemType;
1✔
74
  }
75

76
  public String getItemId() {
77
    return itemId;
1✔
78
  }
79

80
  public String getItemName() {
81
    return itemName;
1✔
82
  }
83

84
  public EventSourceClassificationField getClassification() {
85
    return classification;
×
86
  }
87

88
  public FolderMini getParent() {
89
    return parent;
×
90
  }
91

92
  public UserMini getOwnedBy() {
93
    return ownedBy;
×
94
  }
95

96
  @Override
97
  public boolean equals(Object o) {
98
    if (this == o) {
×
99
      return true;
×
100
    }
101
    if (o == null || getClass() != o.getClass()) {
×
102
      return false;
×
103
    }
104
    EventSource casted = (EventSource) o;
×
105
    return Objects.equals(itemType, casted.itemType)
×
106
        && Objects.equals(itemId, casted.itemId)
×
107
        && Objects.equals(itemName, casted.itemName)
×
108
        && Objects.equals(classification, casted.classification)
×
109
        && Objects.equals(parent, casted.parent)
×
110
        && Objects.equals(ownedBy, casted.ownedBy);
×
111
  }
112

113
  @Override
114
  public int hashCode() {
115
    return Objects.hash(itemType, itemId, itemName, classification, parent, ownedBy);
×
116
  }
117

118
  @Override
119
  public String toString() {
120
    return "EventSource{"
×
121
        + "itemType='"
122
        + itemType
123
        + '\''
124
        + ", "
125
        + "itemId='"
126
        + itemId
127
        + '\''
128
        + ", "
129
        + "itemName='"
130
        + itemName
131
        + '\''
132
        + ", "
133
        + "classification='"
134
        + classification
135
        + '\''
136
        + ", "
137
        + "parent='"
138
        + parent
139
        + '\''
140
        + ", "
141
        + "ownedBy='"
142
        + ownedBy
143
        + '\''
144
        + "}";
145
  }
146

147
  public static class Builder extends NullableFieldTracker {
148

149
    protected final EnumWrapper<EventSourceItemTypeField> itemType;
150

151
    protected final String itemId;
152

153
    protected final String itemName;
154

155
    protected EventSourceClassificationField classification;
156

157
    protected FolderMini parent;
158

159
    protected UserMini ownedBy;
160

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

168
    public Builder(EnumWrapper<EventSourceItemTypeField> itemType, String itemId, String itemName) {
169
      super();
×
170
      this.itemType = itemType;
×
171
      this.itemId = itemId;
×
172
      this.itemName = itemName;
×
173
    }
×
174

175
    public Builder classification(EventSourceClassificationField classification) {
176
      this.classification = classification;
×
177
      return this;
×
178
    }
179

180
    public Builder parent(FolderMini parent) {
181
      this.parent = parent;
×
182
      this.markNullableFieldAsSet("parent");
×
183
      return this;
×
184
    }
185

186
    public Builder ownedBy(UserMini ownedBy) {
187
      this.ownedBy = ownedBy;
×
188
      return this;
×
189
    }
190

191
    public EventSource build() {
192
      return new EventSource(this);
×
193
    }
194
  }
195
}
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