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

box / box-java-sdk / #5076

07 Oct 2025 12:35PM UTC coverage: 37.132% (+0.007%) from 37.125%
#5076

push

github

web-flow
test: Change `Event.additionalDetails` field assertion in events test (box/box-codegen#858) (#1491)

18454 of 49699 relevant lines covered (37.13%)

0.37 hits per line

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

20.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();
1✔
42
    this.id = id;
1✔
43
    this.type = new EnumWrapper<FileBaseTypeField>(FileBaseTypeField.FILE);
1✔
44
  }
1✔
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;
1✔
56
  }
57

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

62
  public EnumWrapper<FileBaseTypeField> getType() {
63
    return type;
1✔
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
      this.type = new EnumWrapper<FileBaseTypeField>(FileBaseTypeField.FILE);
×
114
    }
×
115

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

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

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

132
    public FileBase build() {
133
      return new FileBase(this);
×
134
    }
135
  }
136
}
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