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

box / box-java-sdk / #6779

29 Apr 2026 03:28PM UTC coverage: 12.64% (-0.02%) from 12.66%
#6779

push

github

web-flow
fix(boxsdkgen): Fix java `oneOf` serialization (box/box-codegen#942) (#1805)

0 of 105 new or added lines in 13 files covered. (0.0%)

18 existing lines in 13 files now uncovered.

8374 of 66251 relevant lines covered (12.64%)

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/internal/OneOfOne.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 OneOfOne<T0> extends SerializableObject implements OneOfUnion {
11
  protected static final ObjectMapper OBJECT_MAPPER = new ObjectMapper();
×
12
  protected T0 value0;
13

14
  public OneOfOne(T0 value0) {
×
15
    this.value0 = value0;
×
16
  }
×
17

18
  @Override
19
  public boolean hasAnyNonNullValue() {
NEW
20
    return value0 != null;
×
21
  }
22

23
  public static class OneOfOneSerializer extends JsonSerializer<OneOfOne<?>> {
24

25
    public OneOfOneSerializer() {
26
      super();
×
27
    }
×
28

29
    @Override
30
    public void serialize(
31
        OneOfOne<?> itemEntryField, JsonGenerator gen, SerializerProvider provider)
32
        throws IOException {
33
      if (itemEntryField.value0 != null) {
×
34
        JsonManager.WRITER.writeValue(gen, itemEntryField.value0);
×
NEW
35
        return;
×
36
      }
NEW
37
      gen.writeNull();
×
UNCOV
38
    }
×
39
  }
40
}
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