• 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

54.84
/src/main/java/com/box/sdkgen/schemas/metadatafilter/MetadataFilter.java
1
package com.box.sdkgen.schemas.metadatafilter;
2

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

13
/** A metadata template used to filter the search results. */
14
@JsonFilter("nullablePropertyFilter")
15
public class MetadataFilter extends SerializableObject {
16

17
  /**
18
   * Specifies the scope of the template to filter search results by.
19
   *
20
   * <p>This will be `enterprise_{enterprise_id}` for templates defined for use in this enterprise,
21
   * and `global` for general templates that are available to all enterprises using Box.
22
   */
23
  @JsonDeserialize(using = MetadataFilterScopeField.MetadataFilterScopeFieldDeserializer.class)
24
  @JsonSerialize(using = MetadataFilterScopeField.MetadataFilterScopeFieldSerializer.class)
25
  protected EnumWrapper<MetadataFilterScopeField> scope;
26

27
  /**
28
   * The key of the template used to filter search results.
29
   *
30
   * <p>In many cases the template key is automatically derived of its display name, for example
31
   * `Contract Template` would become `contractTemplate`. In some cases the creator of the template
32
   * will have provided its own template key.
33
   *
34
   * <p>Please [list the templates for an enterprise][list], or get all instances on a [file][file]
35
   * or [folder][folder] to inspect a template's key.
36
   *
37
   * <p>[list]: e://get-metadata-templates-enterprise [file]: e://get-files-id-metadata [folder]:
38
   * e://get-folders-id-metadata
39
   */
40
  protected String templateKey;
41

42
  /**
43
   * Specifies which fields on the template to filter the search results by. When more than one
44
   * field is specified, the query performs a logical `AND` to ensure that the instance of the
45
   * template matches each of the fields specified.
46
   */
47
  protected Map<String, MetadataFilterValue> filters;
48

49
  public MetadataFilter() {
50
    super();
×
51
  }
×
52

53
  protected MetadataFilter(Builder builder) {
54
    super();
1✔
55
    this.scope = builder.scope;
1✔
56
    this.templateKey = builder.templateKey;
1✔
57
    this.filters = builder.filters;
1✔
58
    markNullableFieldsAsSet(builder.getExplicitlySetNullableFields());
1✔
59
  }
1✔
60

61
  public EnumWrapper<MetadataFilterScopeField> getScope() {
62
    return scope;
1✔
63
  }
64

65
  public String getTemplateKey() {
66
    return templateKey;
1✔
67
  }
68

69
  public Map<String, MetadataFilterValue> getFilters() {
70
    return filters;
1✔
71
  }
72

73
  @Override
74
  public boolean equals(Object o) {
75
    if (this == o) {
×
76
      return true;
×
77
    }
78
    if (o == null || getClass() != o.getClass()) {
×
79
      return false;
×
80
    }
81
    MetadataFilter casted = (MetadataFilter) o;
×
82
    return Objects.equals(scope, casted.scope)
×
83
        && Objects.equals(templateKey, casted.templateKey)
×
84
        && Objects.equals(filters, casted.filters);
×
85
  }
86

87
  @Override
88
  public int hashCode() {
89
    return Objects.hash(scope, templateKey, filters);
×
90
  }
91

92
  @Override
93
  public String toString() {
94
    return "MetadataFilter{"
×
95
        + "scope='"
96
        + scope
97
        + '\''
98
        + ", "
99
        + "templateKey='"
100
        + templateKey
101
        + '\''
102
        + ", "
103
        + "filters='"
104
        + filters
105
        + '\''
106
        + "}";
107
  }
108

109
  public static class Builder extends NullableFieldTracker {
1✔
110

111
    protected EnumWrapper<MetadataFilterScopeField> scope;
112

113
    protected String templateKey;
114

115
    protected Map<String, MetadataFilterValue> filters;
116

117
    public Builder scope(MetadataFilterScopeField scope) {
118
      this.scope = new EnumWrapper<MetadataFilterScopeField>(scope);
1✔
119
      return this;
1✔
120
    }
121

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

127
    public Builder templateKey(String templateKey) {
128
      this.templateKey = templateKey;
1✔
129
      return this;
1✔
130
    }
131

132
    public Builder filters(Map<String, MetadataFilterValue> filters) {
133
      this.filters = filters;
1✔
134
      return this;
1✔
135
    }
136

137
    public MetadataFilter build() {
138
      return new MetadataFilter(this);
1✔
139
    }
140
  }
141
}
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