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

box / box-java-sdk / #4583

29 Apr 2025 07:23AM UTC coverage: 72.058% (-0.002%) from 72.06%
#4583

push

github

web-flow
fix: use `Locale.ROOT` to prevent issues with non-US locales (#1306)

14 of 23 new or added lines in 16 files covered. (60.87%)

1 existing line in 1 file now uncovered.

8216 of 11402 relevant lines covered (72.06%)

0.72 hits per line

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

48.39
/src/main/java/com/box/sdk/BoxAIItem.java
1
package com.box.sdk;
2

3
import com.eclipsesource.json.JsonObject;
4

5
/**
6
 * Represents a Box File to be included in a sign request.
7
 */
8
public class BoxAIItem {
9
    private String id;
10
    private Type type;
11
    private String content;
12

13
    /**
14
     * Created a BoxAIItem - the item to be processed by the LLM.
15
     * @param id  The id of the item
16
     * @param type The type of the item. Currently, only "file" is supported.
17
     * @param content The content of the item, often the text representation.
18
     */
19
    public BoxAIItem(String id, Type type, String content) {
×
20
        this.id = id;
×
21
        this.type = type;
×
22
        this.content = content;
×
23
    }
×
24

25
    /**
26
     * Created a BoxAIItem - the item to be processed by the LLM.
27
     * @param id The id of the item
28
     * @param type The type of the item. Currently, only "file" is supported.
29
     */
30
    public BoxAIItem(String id, Type type) {
1✔
31
        this.id = id;
1✔
32
        this.type = type;
1✔
33
    }
1✔
34

35
    /**
36
     * Gets the id of the item.
37
     * @return the id of the item.
38
     */
39
    public String getId() {
40
        return id;
×
41
    }
42

43
    /**
44
     * Sets the id of the item.
45
     * @param id the id of the item.
46
     */
47
    public void setId(String id) {
48
        this.id = id;
×
49
    }
×
50

51
    /**
52
     * Gets the type of the item.
53
     * @return the type of the item.
54
     */
55
    public Type getType() {
56
        return type;
×
57
    }
58

59
    /**
60
     * Sets the type of the item.
61
     * @param type the type of the item.
62
     */
63
    public void setType(Type type) {
64
        this.type = type;
×
65
    }
×
66

67
    /**
68
     * Gets the content of the item.
69
     * @return the content of the item.
70
     */
71
    public String getContent() {
72
        return content;
×
73
    }
74

75
    /**
76
     * Sets the content of the item.
77
     * @param content the content of the item.
78
     */
79
    public void setContent(String content) {
80
        this.content = content;
×
81
    }
×
82

83
    /**
84
     * Gets a JSON object representing this class.
85
     *
86
     * @return the JSON object representing this class.
87
     */
88
    public JsonObject getJSONObject() {
89
        JsonObject itemJSON = new JsonObject()
1✔
90
            .add("id", this.id)
1✔
91
            .add("type", this.type.toJSONValue());
1✔
92

93
        if (this.content != null) {
1✔
94
            itemJSON.add("content", this.content);
×
95
        }
96

97
        return itemJSON;
1✔
98
    }
99

100
    public enum Type {
1✔
101
        /**
102
         * A file.
103
         */
104
        FILE("file");
1✔
105

106

107
        private final String jsonValue;
108

109
        Type(String jsonValue) {
1✔
110
            this.jsonValue = jsonValue;
1✔
111
        }
1✔
112

113
        static BoxAIItem.Type fromJSONValue(String jsonValue) {
NEW
114
            return BoxAIItem.Type.valueOf(jsonValue.toUpperCase(java.util.Locale.ROOT));
×
115
        }
116

117
        String toJSONValue() {
118
            return this.jsonValue;
1✔
119
        }
120
    }
121
}
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