Class FileSearchTool.Filters
-
- All Implemented Interfaces:
public final class FileSearchTool.FiltersA filter to apply.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public interfaceFileSearchTool.Filters.VisitorAn interface that defines how to map each variant of Filters to a value of type T.
-
Method Summary
Modifier and Type Method Description final Optional<ComparisonFilter>comparisonFilter()A filter used to compare a specified attribute key to a given value using a defined comparison operation. final Optional<CompoundFilter>compoundFilter()Combine multiple filters using andoror.final BooleanisComparisonFilter()final BooleanisCompoundFilter()final ComparisonFilterasComparisonFilter()A filter used to compare a specified attribute key to a given value using a defined comparison operation. final CompoundFilterasCompoundFilter()Combine multiple filters using andoror.final Optional<JsonValue>_json()final <T extends Any> Taccept(FileSearchTool.Filters.Visitor<T> visitor)Maps this instance's current variant to a value of type T using the given visitor. final FileSearchTool.Filtersvalidate()Validates that the types of all values in this object match their expected types recursively. final BooleanisValid()Booleanequals(Object other)IntegerhashCode()StringtoString()final static FileSearchTool.FiltersofComparisonFilter(ComparisonFilter comparisonFilter)A filter used to compare a specified attribute key to a given value using a defined comparison operation. final static FileSearchTool.FiltersofCompoundFilter(CompoundFilter compoundFilter)Combine multiple filters using andoror.-
-
Method Detail
-
comparisonFilter
final Optional<ComparisonFilter> comparisonFilter()
A filter used to compare a specified attribute key to a given value using a defined comparison operation.
-
compoundFilter
final Optional<CompoundFilter> compoundFilter()
Combine multiple filters using
andoror.
-
isComparisonFilter
final Boolean isComparisonFilter()
-
isCompoundFilter
final Boolean isCompoundFilter()
-
asComparisonFilter
final ComparisonFilter asComparisonFilter()
A filter used to compare a specified attribute key to a given value using a defined comparison operation.
-
asCompoundFilter
final CompoundFilter asCompoundFilter()
Combine multiple filters using
andoror.
-
accept
final <T extends Any> T accept(FileSearchTool.Filters.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 = filters.accept(new Filters.Visitor<Optional<String>>() { @Override public Optional<String> visitComparisonFilter(ComparisonFilter comparisonFilter) { return Optional.of(comparisonFilter.toString()); } // ... @Override public Optional<String> unknown(JsonValue json) { // Or inspect the `json`. return Optional.empty(); } });
-
validate
final FileSearchTool.Filters 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.
-
ofComparisonFilter
final static FileSearchTool.Filters ofComparisonFilter(ComparisonFilter comparisonFilter)
A filter used to compare a specified attribute key to a given value using a defined comparison operation.
-
ofCompoundFilter
final static FileSearchTool.Filters ofCompoundFilter(CompoundFilter compoundFilter)
Combine multiple filters using
andoror.
-
-
-
-