Class BetaFileSearchTool.Filters
-
- All Implemented Interfaces:
public final class BetaFileSearchTool.FiltersA filter to apply.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public interfaceBetaFileSearchTool.Filters.VisitorAn interface that defines how to map each variant of Filters to a value of type T.
public final classBetaFileSearchTool.Filters.ComparisonFilterA filter used to compare a specified attribute key to a given value using a defined comparison operation.
public final classBetaFileSearchTool.Filters.CompoundFilterCombine multiple filters using
andoror.
-
Method Summary
Modifier and Type Method Description final Optional<BetaFileSearchTool.Filters.ComparisonFilter>comparisonFilter()A filter used to compare a specified attribute key to a given value using a defined comparison operation. final Optional<BetaFileSearchTool.Filters.CompoundFilter>compoundFilter()Combine multiple filters using andoror.final BooleanisComparisonFilter()final BooleanisCompoundFilter()final BetaFileSearchTool.Filters.ComparisonFilterasComparisonFilter()A filter used to compare a specified attribute key to a given value using a defined comparison operation. final BetaFileSearchTool.Filters.CompoundFilterasCompoundFilter()Combine multiple filters using andoror.final Optional<JsonValue>_json()final <T extends Any> Taccept(BetaFileSearchTool.Filters.Visitor<T> visitor)Maps this instance's current variant to a value of type T using the given visitor. final BetaFileSearchTool.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 BetaFileSearchTool.FiltersofComparisonFilter(BetaFileSearchTool.Filters.ComparisonFilter comparisonFilter)A filter used to compare a specified attribute key to a given value using a defined comparison operation. final static BetaFileSearchTool.FiltersofCompoundFilter(BetaFileSearchTool.Filters.CompoundFilter compoundFilter)Combine multiple filters using andoror.-
-
Method Detail
-
comparisonFilter
final Optional<BetaFileSearchTool.Filters.ComparisonFilter> comparisonFilter()
A filter used to compare a specified attribute key to a given value using a defined comparison operation.
-
compoundFilter
final Optional<BetaFileSearchTool.Filters.CompoundFilter> compoundFilter()
Combine multiple filters using
andoror.
-
isComparisonFilter
final Boolean isComparisonFilter()
-
isCompoundFilter
final Boolean isCompoundFilter()
-
asComparisonFilter
final BetaFileSearchTool.Filters.ComparisonFilter asComparisonFilter()
A filter used to compare a specified attribute key to a given value using a defined comparison operation.
-
asCompoundFilter
final BetaFileSearchTool.Filters.CompoundFilter asCompoundFilter()
Combine multiple filters using
andoror.
-
accept
final <T extends Any> T accept(BetaFileSearchTool.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 BetaFileSearchTool.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 BetaFileSearchTool.Filters ofComparisonFilter(BetaFileSearchTool.Filters.ComparisonFilter comparisonFilter)
A filter used to compare a specified attribute key to a given value using a defined comparison operation.
-
ofCompoundFilter
final static BetaFileSearchTool.Filters ofCompoundFilter(BetaFileSearchTool.Filters.CompoundFilter compoundFilter)
Combine multiple filters using
andoror.
-
-
-
-