• 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

0.0
/src/main/java/com/box/sdkgen/schemas/collection/Collection.java
1
package com.box.sdkgen.schemas.collection;
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 Collection extends SerializableObject {
11

12
  protected String id;
13

14
  @JsonDeserialize(using = CollectionTypeField.CollectionTypeFieldDeserializer.class)
15
  @JsonSerialize(using = CollectionTypeField.CollectionTypeFieldSerializer.class)
16
  protected EnumWrapper<CollectionTypeField> type;
17

18
  @JsonDeserialize(using = CollectionNameField.CollectionNameFieldDeserializer.class)
19
  @JsonSerialize(using = CollectionNameField.CollectionNameFieldSerializer.class)
20
  protected EnumWrapper<CollectionNameField> name;
21

22
  @JsonDeserialize(
23
      using = CollectionCollectionTypeField.CollectionCollectionTypeFieldDeserializer.class)
24
  @JsonSerialize(
25
      using = CollectionCollectionTypeField.CollectionCollectionTypeFieldSerializer.class)
26
  @JsonProperty("collection_type")
27
  protected EnumWrapper<CollectionCollectionTypeField> collectionType;
28

29
  public Collection() {
30
    super();
×
31
  }
×
32

33
  protected Collection(Builder builder) {
34
    super();
×
35
    this.id = builder.id;
×
36
    this.type = builder.type;
×
37
    this.name = builder.name;
×
38
    this.collectionType = builder.collectionType;
×
39
  }
×
40

41
  public String getId() {
42
    return id;
×
43
  }
44

45
  public EnumWrapper<CollectionTypeField> getType() {
46
    return type;
×
47
  }
48

49
  public EnumWrapper<CollectionNameField> getName() {
50
    return name;
×
51
  }
52

53
  public EnumWrapper<CollectionCollectionTypeField> getCollectionType() {
54
    return collectionType;
×
55
  }
56

57
  @Override
58
  public boolean equals(Object o) {
59
    if (this == o) {
×
60
      return true;
×
61
    }
62
    if (o == null || getClass() != o.getClass()) {
×
63
      return false;
×
64
    }
65
    Collection casted = (Collection) o;
×
66
    return Objects.equals(id, casted.id)
×
67
        && Objects.equals(type, casted.type)
×
68
        && Objects.equals(name, casted.name)
×
69
        && Objects.equals(collectionType, casted.collectionType);
×
70
  }
71

72
  @Override
73
  public int hashCode() {
74
    return Objects.hash(id, type, name, collectionType);
×
75
  }
76

77
  @Override
78
  public String toString() {
79
    return "Collection{"
×
80
        + "id='"
81
        + id
82
        + '\''
83
        + ", "
84
        + "type='"
85
        + type
86
        + '\''
87
        + ", "
88
        + "name='"
89
        + name
90
        + '\''
91
        + ", "
92
        + "collectionType='"
93
        + collectionType
94
        + '\''
95
        + "}";
96
  }
97

NEW
98
  public static class Builder {
×
99

100
    protected String id;
101

102
    protected EnumWrapper<CollectionTypeField> type;
103

104
    protected EnumWrapper<CollectionNameField> name;
105

106
    protected EnumWrapper<CollectionCollectionTypeField> collectionType;
107

108
    public Builder id(String id) {
109
      this.id = id;
×
110
      return this;
×
111
    }
112

113
    public Builder type(CollectionTypeField type) {
114
      this.type = new EnumWrapper<CollectionTypeField>(type);
×
115
      return this;
×
116
    }
117

118
    public Builder type(EnumWrapper<CollectionTypeField> type) {
119
      this.type = type;
×
120
      return this;
×
121
    }
122

123
    public Builder name(CollectionNameField name) {
124
      this.name = new EnumWrapper<CollectionNameField>(name);
×
125
      return this;
×
126
    }
127

128
    public Builder name(EnumWrapper<CollectionNameField> name) {
129
      this.name = name;
×
130
      return this;
×
131
    }
132

133
    public Builder collectionType(CollectionCollectionTypeField collectionType) {
134
      this.collectionType = new EnumWrapper<CollectionCollectionTypeField>(collectionType);
×
135
      return this;
×
136
    }
137

138
    public Builder collectionType(EnumWrapper<CollectionCollectionTypeField> collectionType) {
UNCOV
139
      this.collectionType = collectionType;
×
140
      return this;
×
141
    }
142

143
    public Collection build() {
144
      return new Collection(this);
×
145
    }
146
  }
147
}
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