Class BetaFileSearchTool.Filters.CompoundFilter.Filter
-
- All Implemented Interfaces:
public final class BetaFileSearchTool.Filters.CompoundFilter.FilterA filter used to compare a specified attribute key to a given value using a defined comparison operation.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public interfaceBetaFileSearchTool.Filters.CompoundFilter.Filter.VisitorAn interface that defines how to map each variant of Filter to a value of type T.
public final classBetaFileSearchTool.Filters.CompoundFilter.Filter.ComparisonFilterA filter used to compare a specified attribute key to a given value using a defined comparison operation.
-
Method Summary
Modifier and Type Method Description final Optional<BetaFileSearchTool.Filters.CompoundFilter.Filter.ComparisonFilter>comparison()A filter used to compare a specified attribute key to a given value using a defined comparison operation. final Optional<JsonValue>jsonValue()final BooleanisComparison()final BooleanisJsonValue()final BetaFileSearchTool.Filters.CompoundFilter.Filter.ComparisonFilterasComparison()A filter used to compare a specified attribute key to a given value using a defined comparison operation. final JsonValueasJsonValue()final Optional<JsonValue>_json()final <T extends Any> Taccept(BetaFileSearchTool.Filters.CompoundFilter.Filter.Visitor<T> visitor)Maps this instance's current variant to a value of type T using the given visitor. final BetaFileSearchTool.Filters.CompoundFilter.Filtervalidate()Validates that the types of all values in this object match their expected types recursively. final BooleanisValid()Booleanequals(Object other)IntegerhashCode()StringtoString()final static BetaFileSearchTool.Filters.CompoundFilter.FilterofComparison(BetaFileSearchTool.Filters.CompoundFilter.Filter.ComparisonFilter comparison)A filter used to compare a specified attribute key to a given value using a defined comparison operation. final static BetaFileSearchTool.Filters.CompoundFilter.FilterofJsonValue(JsonValue jsonValue)-
-
Method Detail
-
comparison
final Optional<BetaFileSearchTool.Filters.CompoundFilter.Filter.ComparisonFilter> comparison()
A filter used to compare a specified attribute key to a given value using a defined comparison operation.
-
isComparison
final Boolean isComparison()
-
isJsonValue
final Boolean isJsonValue()
-
asComparison
final BetaFileSearchTool.Filters.CompoundFilter.Filter.ComparisonFilter asComparison()
A filter used to compare a specified attribute key to a given value using a defined comparison operation.
-
asJsonValue
final JsonValue asJsonValue()
-
accept
final <T extends Any> T accept(BetaFileSearchTool.Filters.CompoundFilter.Filter.Visitor<T> visitor)
Maps this instance's current variant to a value of type T using the given visitor.
Note that this method is not forwards compatible with new variants from the API, unless visitor overrides Visitor.unknown. To handle variants not known to this version of the SDK gracefully, consider overriding Visitor.unknown:
import com.openai.core.JsonValue; import java.util.Optional; Optional<String> result = filter.accept(new Filter.Visitor<Optional<String>>() { @Override public Optional<String> visitComparison(ComparisonFilter comparison) { return Optional.of(comparison.toString()); } // ... @Override public Optional<String> unknown(JsonValue json) { // Or inspect the `json`. return Optional.empty(); } });
-
validate
final BetaFileSearchTool.Filters.CompoundFilter.Filter validate()
Validates that the types of all values in this object match their expected types recursively.
This method is not forwards compatible with new types from the API for existing fields.
-
ofComparison
final static BetaFileSearchTool.Filters.CompoundFilter.Filter ofComparison(BetaFileSearchTool.Filters.CompoundFilter.Filter.ComparisonFilter comparison)
A filter used to compare a specified attribute key to a given value using a defined comparison operation.
-
ofJsonValue
final static BetaFileSearchTool.Filters.CompoundFilter.Filter ofJsonValue(JsonValue jsonValue)
-
-
-
-