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

box / box-java-sdk / #4040

17 Oct 2024 12:51PM CUT coverage: 71.745% (-0.002%) from 71.747%
#4040

push

github

web-flow
chore: release 4.12.0 (#1267)

8039 of 11205 relevant lines covered (71.74%)

0.72 hits per line

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

0.0
/src/main/java/com/box/sdk/MetadataFieldFilter.java
1
package com.box.sdk;
2

3
import com.eclipsesource.json.Json;
4
import com.eclipsesource.json.JsonObject;
5
import com.eclipsesource.json.JsonValue;
6

7
/**
8
 * Filter for matching against a metadata field.
9
 */
10
public class MetadataFieldFilter {
11

12
    private final String field;
13
    private final JsonValue value;
14

15
    /**
16
     * Create a filter for matching against a string metadata field.
17
     *
18
     * @param field the field to match against.
19
     * @param value the value to match against.
20
     */
21
    public MetadataFieldFilter(String field, String value) {
×
22

23
        this.field = field;
×
24
        this.value = Json.value(value);
×
25
    }
×
26

27
    /**
28
     * Create a filter for matching against a metadata field defined in JSON.
29
     *
30
     * @param jsonObj the JSON object to construct the filter from.
31
     */
32
    public MetadataFieldFilter(JsonObject jsonObj) {
×
33
        this.field = jsonObj.get("field").asString();
×
34
        this.value = jsonObj.get("value");
×
35
    }
×
36

37
    /**
38
     * Get the JSON representation of the metadata field filter.
39
     *
40
     * @return the JSON object representing the filter.
41
     */
42
    public JsonObject getJsonObject() {
43

44
        JsonObject obj = new JsonObject();
×
45
        obj.add("field", this.field);
×
46

47
        obj.add("value", this.value);
×
48

49
        return obj;
×
50
    }
51
}
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