• 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

0.0
/src/main/java/com/box/sdkgen/schemas/appitemeventsource/AppItemEventSource.java
1
package com.box.sdkgen.schemas.appitemeventsource;
2

3
import com.box.sdkgen.internal.SerializableObject;
4
import com.box.sdkgen.schemas.groupmini.GroupMini;
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 AppItemEventSource extends SerializableObject {
13

14
  protected final String id;
15

16
  @JsonDeserialize(
17
      using = AppItemEventSourceTypeField.AppItemEventSourceTypeFieldDeserializer.class)
18
  @JsonSerialize(using = AppItemEventSourceTypeField.AppItemEventSourceTypeFieldSerializer.class)
19
  protected EnumWrapper<AppItemEventSourceTypeField> type;
20

21
  @JsonProperty("app_item_type")
22
  protected final String appItemType;
23

24
  protected UserMini user;
25

26
  protected GroupMini group;
27

28
  public AppItemEventSource(
29
      @JsonProperty("id") String id, @JsonProperty("app_item_type") String appItemType) {
30
    super();
×
31
    this.id = id;
×
32
    this.appItemType = appItemType;
×
33
    this.type = new EnumWrapper<AppItemEventSourceTypeField>(AppItemEventSourceTypeField.APP_ITEM);
×
34
  }
×
35

36
  protected AppItemEventSource(Builder builder) {
37
    super();
×
38
    this.id = builder.id;
×
39
    this.type = builder.type;
×
40
    this.appItemType = builder.appItemType;
×
41
    this.user = builder.user;
×
42
    this.group = builder.group;
×
43
  }
×
44

45
  public String getId() {
46
    return id;
×
47
  }
48

49
  public EnumWrapper<AppItemEventSourceTypeField> getType() {
50
    return type;
×
51
  }
52

53
  public String getAppItemType() {
54
    return appItemType;
×
55
  }
56

57
  public UserMini getUser() {
58
    return user;
×
59
  }
60

61
  public GroupMini getGroup() {
62
    return group;
×
63
  }
64

65
  @Override
66
  public boolean equals(Object o) {
67
    if (this == o) {
×
68
      return true;
×
69
    }
70
    if (o == null || getClass() != o.getClass()) {
×
71
      return false;
×
72
    }
73
    AppItemEventSource casted = (AppItemEventSource) o;
×
74
    return Objects.equals(id, casted.id)
×
75
        && Objects.equals(type, casted.type)
×
76
        && Objects.equals(appItemType, casted.appItemType)
×
77
        && Objects.equals(user, casted.user)
×
78
        && Objects.equals(group, casted.group);
×
79
  }
80

81
  @Override
82
  public int hashCode() {
83
    return Objects.hash(id, type, appItemType, user, group);
×
84
  }
85

86
  @Override
87
  public String toString() {
88
    return "AppItemEventSource{"
×
89
        + "id='"
90
        + id
91
        + '\''
92
        + ", "
93
        + "type='"
94
        + type
95
        + '\''
96
        + ", "
97
        + "appItemType='"
98
        + appItemType
99
        + '\''
100
        + ", "
101
        + "user='"
102
        + user
103
        + '\''
104
        + ", "
105
        + "group='"
106
        + group
107
        + '\''
108
        + "}";
109
  }
110

111
  public static class Builder {
112

113
    protected final String id;
114

115
    protected EnumWrapper<AppItemEventSourceTypeField> type;
116

117
    protected final String appItemType;
118

119
    protected UserMini user;
120

121
    protected GroupMini group;
122

NEW
123
    public Builder(String id, String appItemType) {
×
124
      this.id = id;
×
125
      this.appItemType = appItemType;
×
126
      this.type =
×
127
          new EnumWrapper<AppItemEventSourceTypeField>(AppItemEventSourceTypeField.APP_ITEM);
128
    }
×
129

130
    public Builder type(AppItemEventSourceTypeField type) {
131
      this.type = new EnumWrapper<AppItemEventSourceTypeField>(type);
×
132
      return this;
×
133
    }
134

135
    public Builder type(EnumWrapper<AppItemEventSourceTypeField> type) {
136
      this.type = type;
×
137
      return this;
×
138
    }
139

140
    public Builder user(UserMini user) {
141
      this.user = user;
×
142
      return this;
×
143
    }
144

145
    public Builder group(GroupMini group) {
146
      this.group = group;
×
147
      return this;
×
148
    }
149

150
    public AppItemEventSource build() {
151
      return new AppItemEventSource(this);
×
152
    }
153
  }
154
}
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