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

box / box-java-sdk-gen / #360

14 Jul 2025 11:20AM UTC coverage: 38.091% (+2.5%) from 35.58%
#360

push

github

web-flow
feat: Support common union fields and implicit union conversion (box/box-codegen#758) (#361)

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

37.08
/src/main/java/com/box/sdkgen/schemas/filefullorfolderfull/FileFullOrFolderFull.java
1
package com.box.sdkgen.schemas.filefullorfolderfull;
2

3
import com.box.sdkgen.internal.OneOfTwo;
4
import com.box.sdkgen.schemas.filefull.FileFull;
5
import com.box.sdkgen.schemas.folderfull.FolderFull;
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.box.sdkgen.serialization.json.JsonManager;
10
import com.fasterxml.jackson.core.JsonParser;
11
import com.fasterxml.jackson.databind.DeserializationContext;
12
import com.fasterxml.jackson.databind.JsonDeserializer;
13
import com.fasterxml.jackson.databind.JsonMappingException;
14
import com.fasterxml.jackson.databind.JsonNode;
15
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
16
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
17
import java.io.IOException;
18
import java.util.Date;
19
import java.util.List;
20

21
@JsonDeserialize(using = FileFullOrFolderFull.FileFullOrFolderFullDeserializer.class)
22
@JsonSerialize(using = OneOfTwo.OneOfTwoSerializer.class)
23
public class FileFullOrFolderFull extends OneOfTwo<FileFull, FolderFull> {
24

25
  protected final List<String> tags;
26

27
  protected final Boolean isAccessibleViaSharedLink;
28

29
  protected final List<String> allowedInviteeRoles;
30

31
  protected final Boolean isExternallyOwned;
32

33
  protected final Boolean hasCollaborations;
34

35
  protected final Boolean isAssociatedWithAppItem;
36

37
  protected final String description;
38

39
  protected final Long size;
40

41
  protected final Date createdAt;
42

43
  protected final Date modifiedAt;
44

45
  protected final Date trashedAt;
46

47
  protected final Date purgedAt;
48

49
  protected final Date contentCreatedAt;
50

51
  protected final Date contentModifiedAt;
52

53
  protected final UserMini createdBy;
54

55
  protected final UserMini modifiedBy;
56

57
  protected final UserMini ownedBy;
58

59
  protected final FolderMini parent;
60

61
  protected final String itemStatus;
62

63
  protected final String sequenceId;
64

65
  protected final String name;
66

67
  protected final String id;
68

69
  protected final String etag;
70

71
  protected final String type;
72

73
  public FileFullOrFolderFull(FileFull fileFull) {
74
    super(fileFull, null);
1✔
75
    this.tags = fileFull.getTags();
1✔
76
    this.isAccessibleViaSharedLink = fileFull.getIsAccessibleViaSharedLink();
1✔
77
    this.allowedInviteeRoles = EnumWrapper.convertToString(fileFull.getAllowedInviteeRoles());
1✔
78
    this.isExternallyOwned = fileFull.getIsExternallyOwned();
1✔
79
    this.hasCollaborations = fileFull.getHasCollaborations();
1✔
80
    this.isAssociatedWithAppItem = fileFull.getIsAssociatedWithAppItem();
1✔
81
    this.description = fileFull.getDescription();
1✔
82
    this.size = fileFull.getSize();
1✔
83
    this.createdAt = fileFull.getCreatedAt();
1✔
84
    this.modifiedAt = fileFull.getModifiedAt();
1✔
85
    this.trashedAt = fileFull.getTrashedAt();
1✔
86
    this.purgedAt = fileFull.getPurgedAt();
1✔
87
    this.contentCreatedAt = fileFull.getContentCreatedAt();
1✔
88
    this.contentModifiedAt = fileFull.getContentModifiedAt();
1✔
89
    this.createdBy = fileFull.getCreatedBy();
1✔
90
    this.modifiedBy = fileFull.getModifiedBy();
1✔
91
    this.ownedBy = fileFull.getOwnedBy();
1✔
92
    this.parent = fileFull.getParent();
1✔
93
    this.itemStatus = EnumWrapper.convertToString(fileFull.getItemStatus());
1✔
94
    this.sequenceId = fileFull.getSequenceId();
1✔
95
    this.name = fileFull.getName();
1✔
96
    this.id = fileFull.getId();
1✔
97
    this.etag = fileFull.getEtag();
1✔
98
    this.type = EnumWrapper.convertToString(fileFull.getType());
1✔
99
  }
1✔
100

101
  public FileFullOrFolderFull(FolderFull folderFull) {
102
    super(null, folderFull);
×
NEW
103
    this.tags = folderFull.getTags();
×
NEW
104
    this.isAccessibleViaSharedLink = folderFull.getIsAccessibleViaSharedLink();
×
NEW
105
    this.allowedInviteeRoles = EnumWrapper.convertToString(folderFull.getAllowedInviteeRoles());
×
NEW
106
    this.isExternallyOwned = folderFull.getIsExternallyOwned();
×
NEW
107
    this.hasCollaborations = folderFull.getHasCollaborations();
×
NEW
108
    this.isAssociatedWithAppItem = folderFull.getIsAssociatedWithAppItem();
×
NEW
109
    this.description = folderFull.getDescription();
×
NEW
110
    this.size = folderFull.getSize();
×
NEW
111
    this.createdAt = folderFull.getCreatedAt();
×
NEW
112
    this.modifiedAt = folderFull.getModifiedAt();
×
NEW
113
    this.trashedAt = folderFull.getTrashedAt();
×
NEW
114
    this.purgedAt = folderFull.getPurgedAt();
×
NEW
115
    this.contentCreatedAt = folderFull.getContentCreatedAt();
×
NEW
116
    this.contentModifiedAt = folderFull.getContentModifiedAt();
×
NEW
117
    this.createdBy = folderFull.getCreatedBy();
×
NEW
118
    this.modifiedBy = folderFull.getModifiedBy();
×
NEW
119
    this.ownedBy = folderFull.getOwnedBy();
×
NEW
120
    this.parent = folderFull.getParent();
×
NEW
121
    this.itemStatus = EnumWrapper.convertToString(folderFull.getItemStatus());
×
NEW
122
    this.sequenceId = folderFull.getSequenceId();
×
NEW
123
    this.name = folderFull.getName();
×
NEW
124
    this.id = folderFull.getId();
×
NEW
125
    this.etag = folderFull.getEtag();
×
NEW
126
    this.type = EnumWrapper.convertToString(folderFull.getType());
×
NEW
127
  }
×
128

129
  public boolean isFileFull() {
NEW
130
    return value0 != null;
×
131
  }
132

133
  public FileFull getFileFull() {
134
    return value0;
×
135
  }
136

137
  public boolean isFolderFull() {
NEW
138
    return value1 != null;
×
139
  }
140

141
  public FolderFull getFolderFull() {
142
    return value1;
×
143
  }
144

145
  public List<String> getTags() {
NEW
146
    return tags;
×
147
  }
148

149
  public boolean getIsAccessibleViaSharedLink() {
NEW
150
    return isAccessibleViaSharedLink;
×
151
  }
152

153
  public List<String> getAllowedInviteeRoles() {
NEW
154
    return allowedInviteeRoles;
×
155
  }
156

157
  public boolean getIsExternallyOwned() {
NEW
158
    return isExternallyOwned;
×
159
  }
160

161
  public boolean getHasCollaborations() {
NEW
162
    return hasCollaborations;
×
163
  }
164

165
  public boolean getIsAssociatedWithAppItem() {
NEW
166
    return isAssociatedWithAppItem;
×
167
  }
168

169
  public String getDescription() {
NEW
170
    return description;
×
171
  }
172

173
  public long getSize() {
NEW
174
    return size;
×
175
  }
176

177
  public Date getCreatedAt() {
NEW
178
    return createdAt;
×
179
  }
180

181
  public Date getModifiedAt() {
NEW
182
    return modifiedAt;
×
183
  }
184

185
  public Date getTrashedAt() {
NEW
186
    return trashedAt;
×
187
  }
188

189
  public Date getPurgedAt() {
NEW
190
    return purgedAt;
×
191
  }
192

193
  public Date getContentCreatedAt() {
NEW
194
    return contentCreatedAt;
×
195
  }
196

197
  public Date getContentModifiedAt() {
NEW
198
    return contentModifiedAt;
×
199
  }
200

201
  public UserMini getCreatedBy() {
NEW
202
    return createdBy;
×
203
  }
204

205
  public UserMini getModifiedBy() {
NEW
206
    return modifiedBy;
×
207
  }
208

209
  public UserMini getOwnedBy() {
NEW
210
    return ownedBy;
×
211
  }
212

213
  public FolderMini getParent() {
NEW
214
    return parent;
×
215
  }
216

217
  public String getItemStatus() {
NEW
218
    return itemStatus;
×
219
  }
220

221
  public String getSequenceId() {
NEW
222
    return sequenceId;
×
223
  }
224

225
  public String getName() {
NEW
226
    return name;
×
227
  }
228

229
  public String getId() {
NEW
230
    return id;
×
231
  }
232

233
  public String getEtag() {
NEW
234
    return etag;
×
235
  }
236

237
  public String getType() {
NEW
238
    return type;
×
239
  }
240

241
  static class FileFullOrFolderFullDeserializer extends JsonDeserializer<FileFullOrFolderFull> {
242

243
    public FileFullOrFolderFullDeserializer() {
244
      super();
1✔
245
    }
1✔
246

247
    @Override
248
    public FileFullOrFolderFull deserialize(JsonParser jp, DeserializationContext ctxt)
249
        throws IOException {
250
      JsonNode node = JsonManager.jsonToSerializedData(jp);
1✔
251
      JsonNode discriminant0 = node.get("type");
1✔
252
      if (!(discriminant0 == null)) {
1✔
253
        switch (discriminant0.asText()) {
1✔
254
          case "file":
255
            return new FileFullOrFolderFull(JsonManager.deserialize(node, FileFull.class));
1✔
256
          case "folder":
257
            return new FileFullOrFolderFull(JsonManager.deserialize(node, FolderFull.class));
×
258
        }
259
      }
260
      throw new JsonMappingException(jp, "Unable to deserialize FileFullOrFolderFull");
×
261
    }
262
  }
263
}
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