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

box / box-java-sdk / #6860

29 Apr 2026 07:03PM UTC coverage: 34.624% (-0.4%) from 35.045%
#6860

push

github

web-flow
feat: Automate Public API (box/box-openapi#594) (#1820)

19 of 542 new or added lines in 19 files covered. (3.51%)

246 existing lines in 21 files now uncovered.

19116 of 55210 relevant lines covered (34.62%)

0.35 hits per line

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

82.14
/src/main/java/com/box/sdkgen/internal/OneOfFive.java
1
package com.box.sdkgen.internal;
2

3
import com.box.sdkgen.serialization.json.JsonManager;
4
import com.fasterxml.jackson.core.JsonGenerator;
5
import com.fasterxml.jackson.databind.JsonSerializer;
6
import com.fasterxml.jackson.databind.ObjectMapper;
7
import com.fasterxml.jackson.databind.SerializerProvider;
8
import java.io.IOException;
9

10
public class OneOfFive<T0, T1, T2, T3, T4> extends SerializableObject implements OneOfUnion {
11
  protected static final ObjectMapper OBJECT_MAPPER = new ObjectMapper();
1✔
12
  protected T0 value0;
13
  protected T1 value1;
14
  protected T2 value2;
15
  protected T3 value3;
16
  protected T4 value4;
17

18
  public OneOfFive(T0 value0, T1 value1, T2 value2, T3 value3, T4 value4) {
1✔
19
    this.value0 = value0;
1✔
20
    this.value1 = value1;
1✔
21
    this.value2 = value2;
1✔
22
    this.value3 = value3;
1✔
23
    this.value4 = value4;
1✔
24
  }
1✔
25

26
  @Override
27
  public boolean hasAnyNonNullValue() {
UNCOV
28
    return value0 != null || value1 != null || value2 != null || value3 != null || value4 != null;
×
29
  }
30

31
  public static class OneOfFiveSerializer extends JsonSerializer<OneOfFive<?, ?, ?, ?, ?>> {
32

33
    public OneOfFiveSerializer() {
34
      super();
1✔
35
    }
1✔
36

37
    @Override
38
    public void serialize(
39
        OneOfFive<?, ?, ?, ?, ?> itemEntryField, JsonGenerator gen, SerializerProvider provider)
40
        throws IOException {
41
      if (itemEntryField.value0 != null) {
1✔
42
        JsonManager.WRITER.writeValue(gen, itemEntryField.value0);
1✔
43
        return;
1✔
44
      }
45
      if (itemEntryField.value1 != null) {
1✔
UNCOV
46
        JsonManager.WRITER.writeValue(gen, itemEntryField.value1);
×
UNCOV
47
        return;
×
48
      }
49
      if (itemEntryField.value2 != null) {
1✔
50
        JsonManager.WRITER.writeValue(gen, itemEntryField.value2);
1✔
51
        return;
1✔
52
      }
53
      if (itemEntryField.value3 != null) {
1✔
54
        JsonManager.WRITER.writeValue(gen, itemEntryField.value3);
1✔
55
        return;
1✔
56
      }
57
      if (itemEntryField.value4 != null) {
1✔
58
        JsonManager.WRITER.writeValue(gen, itemEntryField.value4);
1✔
59
        return;
1✔
60
      }
UNCOV
61
      gen.writeNull();
×
UNCOV
62
    }
×
63
  }
64
}
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