Package com.sap.ai.sdk.grounding.model
Class Filter
java.lang.Object
com.sap.ai.sdk.grounding.model.Filter
Advanced filter expression for combining metadata filters with boolean logic
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic interfaceBuilder helper class.static interfaceBuilder helper class.static interfaceBuilder helper class.static interfaceBuilder helper class.static interfaceBuilder helper class.static enumBoolean operator for combining filter conditionsstatic enumScope of the metadata filter (e.g., collection, document, chunk) -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionaddValueItem(String valueItem) Add one value instance to thisFilter.static Filter.Buildercreate()Create a type-safe, fluent-api builder object to construct a newFilterinstance with all required arguments.booleangetCustomField(String name) Deprecated.Get the names of the unrecognizable properties of theFilter.getKey()Get keygetLeft()Get leftBoolean operator for combining filter conditionsgetRight()Get rightgetScope()Scope of the metadata filter (e.g., collection, document, chunk)getValue()Get valueinthashCode()Set the key of thisFilterinstance and return the same instance.Set the left of thisFilterinstance and return the same instance.operator(Filter.OperatorEnum operator) Set the operator of thisFilterinstance and return the same instance.Set the right of thisFilterinstance and return the same instance.scope(Filter.ScopeEnum scope) Set the scope of thisFilterinstance and return the same instance.voidsetCustomField(String customFieldName, Object customFieldValue) Set an unrecognizable property of thisFilterinstance.voidSet the key of thisFilterinstance.voidSet the left of thisFilterinstance.voidsetOperator(Filter.OperatorEnum operator) Set the operator of thisFilterinstance.voidSet the right of thisFilterinstance.voidsetScope(Filter.ScopeEnum scope) Set the scope of thisFilterinstance.voidSet the value of thisFilterinstance.toMap()Get the value of all properties of thisFilterinstance including unrecognized properties.toString()Set the value of thisFilterinstance and return the same instance.
-
Constructor Details
-
Filter
protected Filter()Default constructor for Filter.
-
-
Method Details
-
operator
Set the operator of thisFilterinstance and return the same instance.- Parameters:
operator- Boolean operator for combining filter conditions- Returns:
- The same instance of this
Filterclass
-
getOperator
Boolean operator for combining filter conditions- Returns:
- operator The operator of this
Filterinstance.
-
setOperator
Set the operator of thisFilterinstance.- Parameters:
operator- Boolean operator for combining filter conditions
-
left
Set the left of thisFilterinstance and return the same instance. -
getLeft
Get left- Returns:
- left The left of this
Filterinstance.
-
setLeft
Set the left of thisFilterinstance.- Parameters:
left- The left of thisFilter
-
right
Set the right of thisFilterinstance and return the same instance. -
getRight
Get right- Returns:
- right The right of this
Filterinstance.
-
setRight
Set the right of thisFilterinstance.- Parameters:
right- The right of thisFilter
-
key
Set the key of thisFilterinstance and return the same instance. -
getKey
Get key- Returns:
- key The key of this
Filterinstance.
-
setKey
Set the key of thisFilterinstance.- Parameters:
key- The key of thisFilter
-
value
Set the value of thisFilterinstance and return the same instance. -
addValueItem
Add one value instance to thisFilter.- Parameters:
valueItem- The value that should be added- Returns:
- The same instance of type
Filter
-
getValue
Get value- Returns:
- value The value of this
Filterinstance.
-
setValue
Set the value of thisFilterinstance.- Parameters:
value- The value of thisFilter
-
scope
Set the scope of thisFilterinstance and return the same instance.- Parameters:
scope- Scope of the metadata filter (e.g., collection, document, chunk)- Returns:
- The same instance of this
Filterclass
-
getScope
Scope of the metadata filter (e.g., collection, document, chunk)- Returns:
- scope The scope of this
Filterinstance.
-
setScope
Set the scope of thisFilterinstance.- Parameters:
scope- Scope of the metadata filter (e.g., collection, document, chunk)
-
getCustomFieldNames
Get the names of the unrecognizable properties of theFilter.- Returns:
- The set of properties names
-
getCustomField
@Nullable @Deprecated public Object getCustomField(@Nonnull String name) throws NoSuchElementException Deprecated.UsetoMap()instead.Get the value of an unrecognizable property of thisFilterinstance.- Parameters:
name- The name of the property- Returns:
- The value of the property
- Throws:
NoSuchElementException- If no property with the given name could be found.
-
toMap
Get the value of all properties of thisFilterinstance including unrecognized properties.- Returns:
- The map of all properties
-
setCustomField
Set an unrecognizable property of thisFilterinstance. If the map previously contained a mapping for the key, the old value is replaced by the specified value.- Parameters:
customFieldName- The name of the propertycustomFieldValue- The value of the property
-
equals
-
hashCode
public int hashCode() -
toString
-
create
Create a type-safe, fluent-api builder object to construct a newFilterinstance with all required arguments.
-
toMap()instead.