• 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

20.41
/src/main/java/com/box/sdkgen/schemas/metadatacascadepolicy/MetadataCascadePolicy.java
1
package com.box.sdkgen.schemas.metadatacascadepolicy;
2

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

12
/**
13
 * A metadata cascade policy automatically applies a metadata template instance to all the files and
14
 * folders within the targeted folder.
15
 */
16
@JsonFilter("nullablePropertyFilter")
17
public class MetadataCascadePolicy extends SerializableObject {
18

19
  /** The ID of the metadata cascade policy object. */
20
  protected final String id;
21

22
  /** The value will always be `metadata_cascade_policy`. */
23
  @JsonDeserialize(
24
      using = MetadataCascadePolicyTypeField.MetadataCascadePolicyTypeFieldDeserializer.class)
25
  @JsonSerialize(
26
      using = MetadataCascadePolicyTypeField.MetadataCascadePolicyTypeFieldSerializer.class)
27
  protected EnumWrapper<MetadataCascadePolicyTypeField> type;
28

29
  /** The enterprise that owns this policy. */
30
  @JsonProperty("owner_enterprise")
31
  protected MetadataCascadePolicyOwnerEnterpriseField ownerEnterprise;
32

33
  /** Represent the folder the policy is applied to. */
34
  protected MetadataCascadePolicyParentField parent;
35

36
  /**
37
   * The scope of the metadata cascade policy can either be `global` or `enterprise_*`. The `global`
38
   * scope is used for policies that are available to any Box enterprise. The `enterprise_*` scope
39
   * represents policies that have been created within a specific enterprise, where `*` will be the
40
   * ID of that enterprise.
41
   */
42
  protected String scope;
43

44
  /**
45
   * The key of the template that is cascaded down to the folder's children.
46
   *
47
   * <p>In many cases the template key is automatically derived of its display name, for example
48
   * `Contract Template` would become `contractTemplate`. In some cases the creator of the template
49
   * will have provided its own template key.
50
   *
51
   * <p>Please [list the templates for an enterprise][list], or get all instances on a [file][file]
52
   * or [folder][folder] to inspect a template's key.
53
   *
54
   * <p>[list]: https://developer.box.com/reference/get-metadata-templates-enterprise [file]:
55
   * https://developer.box.com/reference/get-files-id-metadata [folder]:
56
   * https://developer.box.com/reference/get-folders-id-metadata
57
   */
58
  protected String templateKey;
59

60
  public MetadataCascadePolicy(@JsonProperty("id") String id) {
61
    super();
1✔
62
    this.id = id;
1✔
63
    this.type =
1✔
64
        new EnumWrapper<MetadataCascadePolicyTypeField>(
65
            MetadataCascadePolicyTypeField.METADATA_CASCADE_POLICY);
66
  }
1✔
67

68
  protected MetadataCascadePolicy(Builder builder) {
69
    super();
×
70
    this.id = builder.id;
×
71
    this.type = builder.type;
×
72
    this.ownerEnterprise = builder.ownerEnterprise;
×
73
    this.parent = builder.parent;
×
74
    this.scope = builder.scope;
×
75
    this.templateKey = builder.templateKey;
×
76
    markNullableFieldsAsSet(builder.getExplicitlySetNullableFields());
×
UNCOV
77
  }
×
78

79
  public String getId() {
80
    return id;
1✔
81
  }
82

83
  public EnumWrapper<MetadataCascadePolicyTypeField> getType() {
84
    return type;
1✔
85
  }
86

87
  public MetadataCascadePolicyOwnerEnterpriseField getOwnerEnterprise() {
88
    return ownerEnterprise;
1✔
89
  }
90

91
  public MetadataCascadePolicyParentField getParent() {
92
    return parent;
1✔
93
  }
94

95
  public String getScope() {
96
    return scope;
1✔
97
  }
98

99
  public String getTemplateKey() {
100
    return templateKey;
1✔
101
  }
102

103
  @Override
104
  public boolean equals(Object o) {
105
    if (this == o) {
×
UNCOV
106
      return true;
×
107
    }
108
    if (o == null || getClass() != o.getClass()) {
×
UNCOV
109
      return false;
×
110
    }
111
    MetadataCascadePolicy casted = (MetadataCascadePolicy) o;
×
112
    return Objects.equals(id, casted.id)
×
113
        && Objects.equals(type, casted.type)
×
114
        && Objects.equals(ownerEnterprise, casted.ownerEnterprise)
×
115
        && Objects.equals(parent, casted.parent)
×
116
        && Objects.equals(scope, casted.scope)
×
UNCOV
117
        && Objects.equals(templateKey, casted.templateKey);
×
118
  }
119

120
  @Override
121
  public int hashCode() {
UNCOV
122
    return Objects.hash(id, type, ownerEnterprise, parent, scope, templateKey);
×
123
  }
124

125
  @Override
126
  public String toString() {
UNCOV
127
    return "MetadataCascadePolicy{"
×
128
        + "id='"
129
        + id
130
        + '\''
131
        + ", "
132
        + "type='"
133
        + type
134
        + '\''
135
        + ", "
136
        + "ownerEnterprise='"
137
        + ownerEnterprise
138
        + '\''
139
        + ", "
140
        + "parent='"
141
        + parent
142
        + '\''
143
        + ", "
144
        + "scope='"
145
        + scope
146
        + '\''
147
        + ", "
148
        + "templateKey='"
149
        + templateKey
150
        + '\''
151
        + "}";
152
  }
153

154
  public static class Builder extends NullableFieldTracker {
155

156
    protected final String id;
157

158
    protected EnumWrapper<MetadataCascadePolicyTypeField> type;
159

160
    protected MetadataCascadePolicyOwnerEnterpriseField ownerEnterprise;
161

162
    protected MetadataCascadePolicyParentField parent;
163

164
    protected String scope;
165

166
    protected String templateKey;
167

168
    public Builder(String id) {
169
      super();
×
170
      this.id = id;
×
UNCOV
171
      this.type =
×
172
          new EnumWrapper<MetadataCascadePolicyTypeField>(
173
              MetadataCascadePolicyTypeField.METADATA_CASCADE_POLICY);
UNCOV
174
    }
×
175

176
    public Builder type(MetadataCascadePolicyTypeField type) {
177
      this.type = new EnumWrapper<MetadataCascadePolicyTypeField>(type);
×
UNCOV
178
      return this;
×
179
    }
180

181
    public Builder type(EnumWrapper<MetadataCascadePolicyTypeField> type) {
182
      this.type = type;
×
UNCOV
183
      return this;
×
184
    }
185

186
    public Builder ownerEnterprise(MetadataCascadePolicyOwnerEnterpriseField ownerEnterprise) {
187
      this.ownerEnterprise = ownerEnterprise;
×
UNCOV
188
      return this;
×
189
    }
190

191
    public Builder parent(MetadataCascadePolicyParentField parent) {
192
      this.parent = parent;
×
UNCOV
193
      return this;
×
194
    }
195

196
    public Builder scope(String scope) {
197
      this.scope = scope;
×
UNCOV
198
      return this;
×
199
    }
200

201
    public Builder templateKey(String templateKey) {
202
      this.templateKey = templateKey;
×
UNCOV
203
      return this;
×
204
    }
205

206
    public MetadataCascadePolicy build() {
UNCOV
207
      return new MetadataCascadePolicy(this);
×
208
    }
209
  }
210
}
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