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

box / box-java-sdk / #5922

17 Dec 2025 05:03PM UTC coverage: 35.498% (-0.4%) from 35.917%
#5922

push

github

web-flow
fix: add taxonomy to Metadata Field (read) definition (box/box-openapi#572) (#1644)

Co-authored-by: box-sdk-build <box-sdk-build@box.com>

2 of 2 new or added lines in 1 file covered. (100.0%)

535 existing lines in 31 files now uncovered.

18926 of 53316 relevant lines covered (35.5%)

0.35 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]: https://developer.box.com/reference/get-metadata-templates-enterprise [file]:
38
   * https://developer.box.com/reference/get-files-id-metadata [folder]:
39
   * https://developer.box.com/reference/get-folders-id-metadata
40
   */
41
  protected String templateKey;
42

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

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

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

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

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

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

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

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

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

110
  public static class Builder extends NullableFieldTracker {
1✔
111

112
    protected EnumWrapper<MetadataFilterScopeField> scope;
113

114
    protected String templateKey;
115

116
    protected Map<String, MetadataFilterValue> filters;
117

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

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

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

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

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

© 2025 Coveralls, Inc