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

box / box-java-sdk / #6240

10 Feb 2026 05:27PM UTC coverage: 12.84%. Remained the same
#6240

push

github

web-flow
fix(boxsdkgen): Move assigning default values from builder constructor to `build()` method (box/box-codegen#922) (#1712)

0 of 1677 new or added lines in 569 files covered. (0.0%)

2130 existing lines in 537 files now uncovered.

8374 of 65218 relevant lines covered (12.84%)

0.13 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/appitemassociation/AppItemAssociation.java
1
package com.box.sdkgen.schemas.appitemassociation;
2

3
import com.box.sdkgen.internal.NullableFieldTracker;
4
import com.box.sdkgen.internal.SerializableObject;
5
import com.box.sdkgen.schemas.appitem.AppItem;
6
import com.box.sdkgen.schemas.appitemassociateditem.AppItemAssociatedItem;
7
import com.box.sdkgen.schemas.filebase.FileBase;
8
import com.box.sdkgen.schemas.folderbase.FolderBase;
9
import com.box.sdkgen.schemas.weblinkbase.WebLinkBase;
10
import com.box.sdkgen.serialization.json.EnumWrapper;
11
import com.fasterxml.jackson.annotation.JsonFilter;
12
import com.fasterxml.jackson.annotation.JsonProperty;
13
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
14
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
15
import java.util.Objects;
16

17
/**
18
 * An app item association represents an association between a file or folder and an app item.
19
 * Associations between a folder and an app item cascade down to all descendants of the folder.
20
 */
21
@JsonFilter("nullablePropertyFilter")
22
public class AppItemAssociation extends SerializableObject {
23

24
  /** The unique identifier for this app item association. */
25
  protected final String id;
26

27
  /** The value will always be `app_item_association`. */
28
  @JsonDeserialize(
29
      using = AppItemAssociationTypeField.AppItemAssociationTypeFieldDeserializer.class)
30
  @JsonSerialize(using = AppItemAssociationTypeField.AppItemAssociationTypeFieldSerializer.class)
31
  protected EnumWrapper<AppItemAssociationTypeField> type;
32

33
  @JsonProperty("app_item")
34
  protected final AppItem appItem;
35

36
  protected final AppItemAssociatedItem item;
37

38
  public AppItemAssociation(String id, AppItem appItem, FileBase item) {
39
    super();
×
40
    this.id = id;
×
41
    this.appItem = appItem;
×
42
    this.item = new AppItemAssociatedItem(item);
×
43
    this.type =
×
44
        new EnumWrapper<AppItemAssociationTypeField>(
45
            AppItemAssociationTypeField.APP_ITEM_ASSOCIATION);
46
  }
×
47

48
  public AppItemAssociation(String id, AppItem appItem, FolderBase item) {
49
    super();
×
50
    this.id = id;
×
51
    this.appItem = appItem;
×
52
    this.item = new AppItemAssociatedItem(item);
×
53
    this.type =
×
54
        new EnumWrapper<AppItemAssociationTypeField>(
55
            AppItemAssociationTypeField.APP_ITEM_ASSOCIATION);
56
  }
×
57

58
  public AppItemAssociation(String id, AppItem appItem, WebLinkBase item) {
59
    super();
×
60
    this.id = id;
×
61
    this.appItem = appItem;
×
62
    this.item = new AppItemAssociatedItem(item);
×
63
    this.type =
×
64
        new EnumWrapper<AppItemAssociationTypeField>(
65
            AppItemAssociationTypeField.APP_ITEM_ASSOCIATION);
66
  }
×
67

68
  public AppItemAssociation(
69
      @JsonProperty("id") String id,
70
      @JsonProperty("app_item") AppItem appItem,
71
      @JsonProperty("item") AppItemAssociatedItem item) {
72
    super();
×
73
    this.id = id;
×
74
    this.appItem = appItem;
×
75
    this.item = item;
×
76
    this.type =
×
77
        new EnumWrapper<AppItemAssociationTypeField>(
78
            AppItemAssociationTypeField.APP_ITEM_ASSOCIATION);
79
  }
×
80

81
  protected AppItemAssociation(Builder builder) {
82
    super();
×
83
    this.id = builder.id;
×
84
    this.type = builder.type;
×
85
    this.appItem = builder.appItem;
×
86
    this.item = builder.item;
×
87
    markNullableFieldsAsSet(builder.getExplicitlySetNullableFields());
×
88
  }
×
89

90
  public String getId() {
91
    return id;
×
92
  }
93

94
  public EnumWrapper<AppItemAssociationTypeField> getType() {
95
    return type;
×
96
  }
97

98
  public AppItem getAppItem() {
99
    return appItem;
×
100
  }
101

102
  public AppItemAssociatedItem getItem() {
103
    return item;
×
104
  }
105

106
  @Override
107
  public boolean equals(Object o) {
108
    if (this == o) {
×
109
      return true;
×
110
    }
111
    if (o == null || getClass() != o.getClass()) {
×
112
      return false;
×
113
    }
114
    AppItemAssociation casted = (AppItemAssociation) o;
×
115
    return Objects.equals(id, casted.id)
×
116
        && Objects.equals(type, casted.type)
×
117
        && Objects.equals(appItem, casted.appItem)
×
118
        && Objects.equals(item, casted.item);
×
119
  }
120

121
  @Override
122
  public int hashCode() {
123
    return Objects.hash(id, type, appItem, item);
×
124
  }
125

126
  @Override
127
  public String toString() {
128
    return "AppItemAssociation{"
×
129
        + "id='"
130
        + id
131
        + '\''
132
        + ", "
133
        + "type='"
134
        + type
135
        + '\''
136
        + ", "
137
        + "appItem='"
138
        + appItem
139
        + '\''
140
        + ", "
141
        + "item='"
142
        + item
143
        + '\''
144
        + "}";
145
  }
146

147
  public static class Builder extends NullableFieldTracker {
148

149
    protected final String id;
150

151
    protected EnumWrapper<AppItemAssociationTypeField> type;
152

153
    protected final AppItem appItem;
154

155
    protected final AppItemAssociatedItem item;
156

157
    public Builder(String id, AppItem appItem, FileBase item) {
158
      super();
×
159
      this.id = id;
×
160
      this.appItem = appItem;
×
161
      this.item = new AppItemAssociatedItem(item);
×
162
    }
×
163

164
    public Builder(String id, AppItem appItem, FolderBase item) {
165
      super();
×
166
      this.id = id;
×
UNCOV
167
      this.appItem = appItem;
×
UNCOV
168
      this.item = new AppItemAssociatedItem(item);
×
169
    }
×
170

171
    public Builder(String id, AppItem appItem, WebLinkBase item) {
UNCOV
172
      super();
×
173
      this.id = id;
×
174
      this.appItem = appItem;
×
175
      this.item = new AppItemAssociatedItem(item);
×
176
    }
×
177

178
    public Builder(String id, AppItem appItem, AppItemAssociatedItem item) {
UNCOV
179
      super();
×
UNCOV
180
      this.id = id;
×
UNCOV
181
      this.appItem = appItem;
×
182
      this.item = item;
×
183
    }
×
184

185
    public Builder type(AppItemAssociationTypeField type) {
UNCOV
186
      this.type = new EnumWrapper<AppItemAssociationTypeField>(type);
×
UNCOV
187
      return this;
×
188
    }
189

190
    public Builder type(EnumWrapper<AppItemAssociationTypeField> type) {
UNCOV
191
      this.type = type;
×
UNCOV
192
      return this;
×
193
    }
194

195
    public AppItemAssociation build() {
NEW
196
      if (this.type == null) {
×
NEW
197
        this.type =
×
198
            new EnumWrapper<AppItemAssociationTypeField>(
199
                AppItemAssociationTypeField.APP_ITEM_ASSOCIATION);
200
      }
UNCOV
201
      return new AppItemAssociation(this);
×
202
    }
203
  }
204
}
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