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

smartsheet / smartsheet-java-sdk / #67

09 Jul 2026 02:57PM UTC coverage: 59.797% (-0.2%) from 59.997%
#67

push

github

web-flow
Merge pull request #183 from smartsheet/release/4.2.0

Prepare for release v4.2.0

4532 of 7579 relevant lines covered (59.8%)

0.6 hits per line

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

80.0
/src/main/java/com/smartsheet/api/models/ReportFilterObjectValue.java
1
/*
2
 * Copyright (C) 2025 Smartsheet
3
 *
4
 * Licensed under the Apache License, Version 2.0 (the "License");
5
 * you may not use this file except in compliance with the License.
6
 * You may obtain a copy of the License at
7
 *
8
 *      http://www.apache.org/licenses/LICENSE-2.0
9
 *
10
 * Unless required by applicable law or agreed to in writing, software
11
 * distributed under the License is distributed on an "AS IS" BASIS,
12
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
 * See the License for the specific language governing permissions and
14
 * limitations under the License.
15
 */
16

17
package com.smartsheet.api.models;
18

19
import com.smartsheet.api.models.enums.ObjectValueType;
20

21
import java.util.Date;
22

23
/**
24
 * Marker interface for filter values used in {@link ReportFilterCriterion}.
25
 * <p>
26
 * This is a standalone interface (it does not extend {@link ObjectValue}) that provides type
27
 * safety for report filter values and exposes each value's {@link ObjectValueType}.
28
 * Implementations include:
29
 * <ul>
30
 * <li>{@link StringObjectValue} - for string values</li>
31
 * <li>{@link NumberObjectValue} - for numeric values</li>
32
 * <li>{@link DateObjectValue} - for date values</li>
33
 * <li>{@link CurrentUserObjectValue} - for current user filters</li>
34
 * </ul>
35
 * <p>
36
 * Static factory methods provide convenient ways to create filter values:
37
 * <pre>
38
 * criterion.setValues(Arrays.asList(
39
 *     ReportFilterObjectValue.string("value1"),
40
 *     ReportFilterObjectValue.number(42),
41
 *     ReportFilterObjectValue.date("2024-01-01"),
42
 *     ReportFilterObjectValue.currentUser()
43
 * ));
44
 * </pre>
45
 */
46
public interface ReportFilterObjectValue {
47

48
    /**
49
     * Gets the object value type for this filter value.
50
     *
51
     * @return the {@link ObjectValueType}
52
     */
53
    ObjectValueType getObjectType();
54

55
    /**
56
     * Creates a string filter value.
57
     *
58
     * @param value the string value
59
     * @return a StringObjectValue implementing ReportFilterObjectValue
60
     */
61
    static ReportFilterObjectValue string(String value) {
62
        return new StringObjectValue(value);
1✔
63
    }
64

65
    /**
66
     * Creates a numeric filter value.
67
     *
68
     * @param value the numeric value
69
     * @return a NumberObjectValue implementing ReportFilterObjectValue
70
     */
71
    static ReportFilterObjectValue number(Number value) {
72
        return new NumberObjectValue(value);
1✔
73
    }
74

75
    /**
76
     * Creates a date filter value with DATE objectType.
77
     * <p>
78
     * The value should be in ISO 8601 format: "yyyy-MM-dd"
79
     *
80
     * @param value the date string in "yyyy-MM-dd" format
81
     * @return a DateObjectValue with DATE objectType implementing ReportFilterObjectValue
82
     */
83
    static ReportFilterObjectValue date(String value) {
84
        return new DateObjectValue(ObjectValueType.DATE, value);
1✔
85
    }
86

87
    /**
88
     * Creates a date filter value from a Java Date object.
89
     *
90
     * @param date the Date object
91
     * @return a DateObjectValue with DATE objectType implementing ReportFilterObjectValue
92
     */
93
    static ReportFilterObjectValue date(Date date) {
94
        return DateObjectValue.fromDate(ObjectValueType.DATE, date);
×
95
    }
96

97
    /**
98
     * Creates a CURRENT_USER filter value.
99
     * <p>
100
     * This represents a special filter value that matches the current authenticated user.
101
     * The value is typically empty or set to a placeholder as the server interprets this
102
     * based on the objectType.
103
     *
104
     * @return a CurrentUserObjectValue implementing ReportFilterObjectValue
105
     */
106
    static ReportFilterObjectValue currentUser() {
107
        return new CurrentUserObjectValue();
1✔
108
    }
109
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE TRIAL · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc