Package com.sap.ai.sdk.grounding.model

# Class Filter

java.lang.Object
com.sap.ai.sdk.grounding.model.Filter

public class Filter extends Object
Advanced filter expression for combining metadata filters with boolean logic

- ## Nested Class Summary

  Nested Classes
  Modifier and Type
  Class
  Description
  `static interface`
  `Filter.Builder`
  Builder helper class.
  `static interface`
  `Filter.Builder1`
  Builder helper class.
  `static interface`
  `Filter.Builder2`
  Builder helper class.
  `static interface`
  `Filter.Builder3`
  Builder helper class.
  `static interface`
  `Filter.Builder4`
  Builder helper class.
  `static enum`
  `Filter.OperatorEnum`
  Boolean operator for combining filter conditions
  `static enum`
  `Filter.ScopeEnum`
  Scope of the metadata filter (e.g., collection, document, chunk)

- ## Constructor Summary

  Constructors
  Modifier
  Constructor
  Description
  `protected`
  `Filter()`
  Default constructor for Filter.

- ## Method Summary

  Modifier and Type
  Method
  Description
  `Filter`
  `addValueItem(String valueItem)`
  Add one value instance to this `Filter`.
  `static Filter.Builder`
  `create()`
  Create a type-safe, fluent-api builder object to construct a new `Filter` instance with all required arguments.
  `boolean`
  `equals(Object o)`
  `Object`
  `getCustomField(String name)`
  Deprecated.
  Use `toMap()` instead.
  `Set<String>`
  `getCustomFieldNames()`
  Get the names of the unrecognizable properties of the `Filter`.
  `String`
  `getKey()`
  Get key
  `Left1`
  `getLeft()`
  Get left
  `Filter.OperatorEnum`
  `getOperator()`
  Boolean operator for combining filter conditions
  `Right1`
  `getRight()`
  Get right
  `Filter.ScopeEnum`
  `getScope()`
  Scope of the metadata filter (e.g., collection, document, chunk)
  `List<String>`
  `getValue()`
  Get value
  `int`
  `hashCode()`
  `Filter`
  `key(String key)`
  Set the key of this `Filter` instance and return the same instance.
  `Filter`
  `left(Left1 left)`
  Set the left of this `Filter` instance and return the same instance.
  `Filter`
  `operator(Filter.OperatorEnum operator)`
  Set the operator of this `Filter` instance and return the same instance.
  `Filter`
  `right(Right1 right)`
  Set the right of this `Filter` instance and return the same instance.
  `Filter`
  `scope(Filter.ScopeEnum scope)`
  Set the scope of this `Filter` instance and return the same instance.
  `void`
  `setCustomField(String customFieldName, Object customFieldValue)`
  Set an unrecognizable property of this `Filter` instance.
  `void`
  `setKey(String key)`
  Set the key of this `Filter` instance.
  `void`
  `setLeft(Left1 left)`
  Set the left of this `Filter` instance.
  `void`
  `setOperator(Filter.OperatorEnum operator)`
  Set the operator of this `Filter` instance.
  `void`
  `setRight(Right1 right)`
  Set the right of this `Filter` instance.
  `void`
  `setScope(Filter.ScopeEnum scope)`
  Set the scope of this `Filter` instance.
  `void`
  `setValue(List<String> value)`
  Set the value of this `Filter` instance.
  `Map<String,Object>`
  `toMap()`
  Get the value of all properties of this `Filter` instance including unrecognized properties.
  `String`
  `toString()`
  `Filter`
  `value(List<String> value)`
  Set the value of this `Filter` instance and return the same instance.

  ### Methods inherited from class java.lang.Object

  `clone, finalize, getClass, notify, notifyAll, wait, wait, wait`

- ## Constructor Details

  - ### Filter

    protected Filter()
    Default constructor for Filter.

- ## Method Details

  - ### operator

    @Nonnull public Filter operator(@Nonnull Filter.OperatorEnum operator)
    Set the operator of this `Filter` instance and return the same instance.
    Parameters:
      `operator` - Boolean operator for combining filter conditions
    Returns:
      The same instance of this `Filter` class

  - ### getOperator

    @Nonnull public Filter.OperatorEnum getOperator()
    Boolean operator for combining filter conditions
    Returns:
      operator The operator of this `Filter` instance.

  - ### setOperator

    public void setOperator(@Nonnull Filter.OperatorEnum operator)
    Set the operator of this `Filter` instance.
    Parameters:
      `operator` - Boolean operator for combining filter conditions

  - ### left

    @Nonnull public Filter left(@Nonnull Left1 left)
    Set the left of this `Filter` instance and return the same instance.
    Parameters:
      `left` - The left of this `Filter`
    Returns:
      The same instance of this `Filter` class

  - ### getLeft

    @Nonnull public Left1 getLeft()
    Get left
    Returns:
      left The left of this `Filter` instance.

  - ### setLeft

    public void setLeft(@Nonnull Left1 left)
    Set the left of this `Filter` instance.
    Parameters:
      `left` - The left of this `Filter`

  - ### right

    @Nonnull public Filter right(@Nonnull Right1 right)
    Set the right of this `Filter` instance and return the same instance.
    Parameters:
      `right` - The right of this `Filter`
    Returns:
      The same instance of this `Filter` class

  - ### getRight

    @Nonnull public Right1 getRight()
    Get right
    Returns:
      right The right of this `Filter` instance.

  - ### setRight

    public void setRight(@Nonnull Right1 right)
    Set the right of this `Filter` instance.
    Parameters:
      `right` - The right of this `Filter`

  - ### key

    @Nonnull public Filter key(@Nonnull String key)
    Set the key of this `Filter` instance and return the same instance.
    Parameters:
      `key` - The key of this `Filter`
    Returns:
      The same instance of this `Filter` class

  - ### getKey

    @Nonnull public String getKey()
    Get key
    Returns:
      key The key of this `Filter` instance.

  - ### setKey

    public void setKey(@Nonnull String key)
    Set the key of this `Filter` instance.
    Parameters:
      `key` - The key of this `Filter`

  - ### value

    @Nonnull public Filter value(@Nonnull List<String> value)
    Set the value of this `Filter` instance and return the same instance.
    Parameters:
      `value` - The value of this `Filter`
    Returns:
      The same instance of this `Filter` class

  - ### addValueItem

    @Nonnull public Filter addValueItem(@Nonnull String valueItem)
    Add one value instance to this `Filter`.
    Parameters:
      `valueItem` - The value that should be added
    Returns:
      The same instance of type `Filter`

  - ### getValue

    @Nonnull public List<String> getValue()
    Get value
    Returns:
      value The value of this `Filter` instance.

  - ### setValue

    public void setValue(@Nonnull List<String> value)
    Set the value of this `Filter` instance.
    Parameters:
      `value` - The value of this `Filter`

  - ### scope

    @Nonnull public Filter scope(@Nullable Filter.ScopeEnum scope)
    Set the scope of this `Filter` instance and return the same instance.
    Parameters:
      `scope` - Scope of the metadata filter (e.g., collection, document, chunk)
    Returns:
      The same instance of this `Filter` class

  - ### getScope

    @Nonnull public Filter.ScopeEnum getScope()
    Scope of the metadata filter (e.g., collection, document, chunk)
    Returns:
      scope The scope of this `Filter` instance.

  - ### setScope

    public void setScope(@Nullable Filter.ScopeEnum scope)
    Set the scope of this `Filter` instance.
    Parameters:
      `scope` - Scope of the metadata filter (e.g., collection, document, chunk)

  - ### getCustomFieldNames

    @Nonnull public Set<String> getCustomFieldNames()
    Get the names of the unrecognizable properties of the `Filter`.
    Returns:
      The set of properties names

  - ### getCustomField

    @Nullable @Deprecated public Object getCustomField(@Nonnull String name) throws NoSuchElementException
    Deprecated.
    Use `toMap()` instead.
    Get the value of an unrecognizable property of this `Filter` instance.
    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

    @Nonnull public Map<String,Object> toMap()
    Get the value of all properties of this `Filter` instance including unrecognized properties.
    Returns:
      The map of all properties

  - ### setCustomField

    public void setCustomField(@Nonnull String customFieldName, @Nullable Object customFieldValue)
    Set an unrecognizable property of this `Filter` instance. 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 property
      `customFieldValue` - The value of the property

  - ### equals

    public boolean equals(@Nullable Object o)
    Overrides:
      `equals` in class `Object`

  - ### hashCode

    public int hashCode()
    Overrides:
      `hashCode` in class `Object`

  - ### toString

    @Nonnull public String toString()
    Overrides:
      `toString` in class `Object`

  - ### create

    public static Filter.Builder create()
    Create a type-safe, fluent-api builder object to construct a new `Filter` instance with all required arguments.