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

box / box-java-sdk-gen / #226

20 Jun 2025 03:14PM UTC coverage: 35.609% (-0.2%) from 35.816%
#226

push

github

web-flow
feat: Shorten builder names in Java (box/box-codegen#742) (#334)

367 of 1570 new or added lines in 984 files covered. (23.38%)

674 existing lines in 370 files now uncovered.

16125 of 45284 relevant lines covered (35.61%)

0.36 hits per line

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

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

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

10
public class MetadataCascadePolicy extends SerializableObject {
11

12
  protected final String id;
13

14
  @JsonDeserialize(
15
      using = MetadataCascadePolicyTypeField.MetadataCascadePolicyTypeFieldDeserializer.class)
16
  @JsonSerialize(
17
      using = MetadataCascadePolicyTypeField.MetadataCascadePolicyTypeFieldSerializer.class)
18
  protected EnumWrapper<MetadataCascadePolicyTypeField> type;
19

20
  @JsonProperty("owner_enterprise")
21
  protected MetadataCascadePolicyOwnerEnterpriseField ownerEnterprise;
22

23
  protected MetadataCascadePolicyParentField parent;
24

25
  protected String scope;
26

27
  protected String templateKey;
28

29
  public MetadataCascadePolicy(@JsonProperty("id") String id) {
30
    super();
1✔
31
    this.id = id;
1✔
32
    this.type =
1✔
33
        new EnumWrapper<MetadataCascadePolicyTypeField>(
34
            MetadataCascadePolicyTypeField.METADATA_CASCADE_POLICY);
35
  }
1✔
36

37
  protected MetadataCascadePolicy(Builder builder) {
38
    super();
×
39
    this.id = builder.id;
×
40
    this.type = builder.type;
×
41
    this.ownerEnterprise = builder.ownerEnterprise;
×
42
    this.parent = builder.parent;
×
43
    this.scope = builder.scope;
×
44
    this.templateKey = builder.templateKey;
×
45
  }
×
46

47
  public String getId() {
48
    return id;
1✔
49
  }
50

51
  public EnumWrapper<MetadataCascadePolicyTypeField> getType() {
52
    return type;
1✔
53
  }
54

55
  public MetadataCascadePolicyOwnerEnterpriseField getOwnerEnterprise() {
56
    return ownerEnterprise;
1✔
57
  }
58

59
  public MetadataCascadePolicyParentField getParent() {
60
    return parent;
1✔
61
  }
62

63
  public String getScope() {
64
    return scope;
1✔
65
  }
66

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

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

88
  @Override
89
  public int hashCode() {
90
    return Objects.hash(id, type, ownerEnterprise, parent, scope, templateKey);
×
91
  }
92

93
  @Override
94
  public String toString() {
95
    return "MetadataCascadePolicy{"
×
96
        + "id='"
97
        + id
98
        + '\''
99
        + ", "
100
        + "type='"
101
        + type
102
        + '\''
103
        + ", "
104
        + "ownerEnterprise='"
105
        + ownerEnterprise
106
        + '\''
107
        + ", "
108
        + "parent='"
109
        + parent
110
        + '\''
111
        + ", "
112
        + "scope='"
113
        + scope
114
        + '\''
115
        + ", "
116
        + "templateKey='"
117
        + templateKey
118
        + '\''
119
        + "}";
120
  }
121

122
  public static class Builder {
123

124
    protected final String id;
125

126
    protected EnumWrapper<MetadataCascadePolicyTypeField> type;
127

128
    protected MetadataCascadePolicyOwnerEnterpriseField ownerEnterprise;
129

130
    protected MetadataCascadePolicyParentField parent;
131

132
    protected String scope;
133

134
    protected String templateKey;
135

NEW
136
    public Builder(String id) {
×
137
      this.id = id;
×
138
      this.type =
×
139
          new EnumWrapper<MetadataCascadePolicyTypeField>(
140
              MetadataCascadePolicyTypeField.METADATA_CASCADE_POLICY);
141
    }
×
142

143
    public Builder type(MetadataCascadePolicyTypeField type) {
144
      this.type = new EnumWrapper<MetadataCascadePolicyTypeField>(type);
×
145
      return this;
×
146
    }
147

148
    public Builder type(EnumWrapper<MetadataCascadePolicyTypeField> type) {
149
      this.type = type;
×
150
      return this;
×
151
    }
152

153
    public Builder ownerEnterprise(MetadataCascadePolicyOwnerEnterpriseField ownerEnterprise) {
UNCOV
154
      this.ownerEnterprise = ownerEnterprise;
×
155
      return this;
×
156
    }
157

158
    public Builder parent(MetadataCascadePolicyParentField parent) {
159
      this.parent = parent;
×
160
      return this;
×
161
    }
162

163
    public Builder scope(String scope) {
164
      this.scope = scope;
×
165
      return this;
×
166
    }
167

168
    public Builder templateKey(String templateKey) {
169
      this.templateKey = templateKey;
×
170
      return this;
×
171
    }
172

173
    public MetadataCascadePolicy build() {
174
      return new MetadataCascadePolicy(this);
×
175
    }
176
  }
177
}
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