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

box / box-java-sdk / #6243

10 Feb 2026 05:27PM UTC coverage: 18.192% (-17.5%) from 35.714%
#6243

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%)

2147 existing lines in 545 files now uncovered.

7388 of 40611 relevant lines covered (18.19%)

0.21 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/filebase/FileBase.java
1
package com.box.sdkgen.schemas.filebase;
2

3
import com.box.sdkgen.internal.Nullable;
4
import com.box.sdkgen.internal.NullableFieldTracker;
5
import com.box.sdkgen.internal.SerializableObject;
6
import com.box.sdkgen.serialization.json.EnumWrapper;
7
import com.fasterxml.jackson.annotation.JsonFilter;
8
import com.fasterxml.jackson.annotation.JsonProperty;
9
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
10
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
11
import java.util.Objects;
12

13
/**
14
 * The bare basic representation of a file, the minimal amount of fields returned when using the
15
 * `fields` query parameter.
16
 */
17
@JsonFilter("nullablePropertyFilter")
18
public class FileBase extends SerializableObject {
19

20
  /**
21
   * The unique identifier that represent a file.
22
   *
23
   * <p>The ID for any file can be determined by visiting a file in the web application and copying
24
   * the ID from the URL. For example, for the URL `https://*.app.box.com/files/123` the `file_id`
25
   * is `123`.
26
   */
27
  protected final String id;
28

29
  /**
30
   * The HTTP `etag` of this file. This can be used within some API endpoints in the `If-Match` and
31
   * `If-None-Match` headers to only perform changes on the file if (no) changes have happened.
32
   */
33
  @Nullable protected String etag;
34

35
  /** The value will always be `file`. */
36
  @JsonDeserialize(using = FileBaseTypeField.FileBaseTypeFieldDeserializer.class)
37
  @JsonSerialize(using = FileBaseTypeField.FileBaseTypeFieldSerializer.class)
38
  protected EnumWrapper<FileBaseTypeField> type;
39

40
  public FileBase(@JsonProperty("id") String id) {
41
    super();
×
42
    this.id = id;
×
43
    this.type = new EnumWrapper<FileBaseTypeField>(FileBaseTypeField.FILE);
×
44
  }
×
45

46
  protected FileBase(Builder builder) {
47
    super();
×
48
    this.id = builder.id;
×
49
    this.etag = builder.etag;
×
50
    this.type = builder.type;
×
51
    markNullableFieldsAsSet(builder.getExplicitlySetNullableFields());
×
52
  }
×
53

54
  public String getId() {
55
    return id;
×
56
  }
57

58
  public String getEtag() {
59
    return etag;
×
60
  }
61

62
  public EnumWrapper<FileBaseTypeField> getType() {
63
    return type;
×
64
  }
65

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

80
  @Override
81
  public int hashCode() {
82
    return Objects.hash(id, etag, type);
×
83
  }
84

85
  @Override
86
  public String toString() {
87
    return "FileBase{"
×
88
        + "id='"
89
        + id
90
        + '\''
91
        + ", "
92
        + "etag='"
93
        + etag
94
        + '\''
95
        + ", "
96
        + "type='"
97
        + type
98
        + '\''
99
        + "}";
100
  }
101

102
  public static class Builder extends NullableFieldTracker {
103

104
    protected final String id;
105

106
    protected String etag;
107

108
    protected EnumWrapper<FileBaseTypeField> type;
109

110
    public Builder(String id) {
111
      super();
×
112
      this.id = id;
×
113
    }
×
114

115
    public Builder etag(String etag) {
116
      this.etag = etag;
×
117
      this.markNullableFieldAsSet("etag");
×
UNCOV
118
      return this;
×
119
    }
120

121
    public Builder type(FileBaseTypeField type) {
122
      this.type = new EnumWrapper<FileBaseTypeField>(type);
×
UNCOV
123
      return this;
×
124
    }
125

126
    public Builder type(EnumWrapper<FileBaseTypeField> type) {
127
      this.type = type;
×
UNCOV
128
      return this;
×
129
    }
130

131
    public FileBase build() {
NEW
132
      if (this.type == null) {
×
NEW
133
        this.type = new EnumWrapper<FileBaseTypeField>(FileBaseTypeField.FILE);
×
134
      }
UNCOV
135
      return new FileBase(this);
×
136
    }
137
  }
138
}
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