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

# Class SearchFilter

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

public class SearchFilter extends Object
SearchFilter

- ## Nested Class Summary

  Nested Classes
  Modifier and Type
  Class
  Description
  `static interface`
  `SearchFilter.Builder`
  Builder helper class.
  `static interface`
  `SearchFilter.Builder1`
  Builder helper class.
  `static interface`
  `SearchFilter.Builder2`
  Builder helper class.

- ## Constructor Summary

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

- ## Method Summary

  Modifier and Type
  Method
  Description
  `SearchFilter`
  `_configuration(SearchConfiguration _configuration)`
  Set the _configuration of this `SearchFilter` instance and return the same instance.
  `SearchFilter`
  `addChunkMetadataItem(KeyValueListPair chunkMetadataItem)`
  Add one chunkMetadata instance to this `SearchFilter`.
  `SearchFilter`
  `addCollectionIdsItem(String collectionIdsItem)`
  Add one collectionIds instance to this `SearchFilter`.
  `SearchFilter`
  `addCollectionMetadataItem(KeyValueListPair collectionMetadataItem)`
  Add one collectionMetadata instance to this `SearchFilter`.
  `SearchFilter`
  `addDocumentMetadataItem(SearchDocumentKeyValueListPair documentMetadataItem)`
  Add one documentMetadata instance to this `SearchFilter`.
  `SearchFilter`
  `chunkMetadata(List<KeyValueListPair> chunkMetadata)`
  Set the chunkMetadata of this `SearchFilter` instance and return the same instance.
  `SearchFilter`
  `collectionIds(List<String> collectionIds)`
  Set the collectionIds of this `SearchFilter` instance and return the same instance.
  `SearchFilter`
  `collectionMetadata(List<KeyValueListPair> collectionMetadata)`
  Set the collectionMetadata of this `SearchFilter` instance and return the same instance.
  `static SearchFilter.Builder`
  `create()`
  Create a type-safe, fluent-api builder object to construct a new `SearchFilter` instance with all required arguments.
  `SearchFilter`
  `documentMetadata(List<SearchDocumentKeyValueListPair> documentMetadata)`
  Set the documentMetadata of this `SearchFilter` instance and return the same instance.
  `boolean`
  `equals(Object o)`
  `List<KeyValueListPair>`
  `getChunkMetadata()`
  Restrict chunks considered during search to those with the given metadata.
  `List<String>`
  `getCollectionIds()`
  Get collectionIds
  `List<KeyValueListPair>`
  `getCollectionMetadata()`
  Restrict collections considered during search to those annotated with the given metadata.
  `SearchConfiguration`
  `getConfiguration()`
  Get _configuration
  `Object`
  `getCustomField(String name)`
  Deprecated.
  Use `toMap()` instead.
  `Set<String>`
  `getCustomFieldNames()`
  Get the names of the unrecognizable properties of the `SearchFilter`.
  `List<SearchDocumentKeyValueListPair>`
  `getDocumentMetadata()`
  Restrict documents considered during search to those annotated with the given metadata.
  `String`
  `getId()`
  Identifier of this SearchFilter - unique per request.
  `int`
  `hashCode()`
  `SearchFilter`
  `id(String id)`
  Set the id of this `SearchFilter` instance and return the same instance.
  `void`
  `setChunkMetadata(List<KeyValueListPair> chunkMetadata)`
  Set the chunkMetadata of this `SearchFilter` instance.
  `void`
  `setCollectionIds(List<String> collectionIds)`
  Set the collectionIds of this `SearchFilter` instance.
  `void`
  `setCollectionMetadata(List<KeyValueListPair> collectionMetadata)`
  Set the collectionMetadata of this `SearchFilter` instance.
  `void`
  `setConfiguration(SearchConfiguration _configuration)`
  Set the _configuration of this `SearchFilter` instance.
  `void`
  `setCustomField(String customFieldName, Object customFieldValue)`
  Set an unrecognizable property of this `SearchFilter` instance.
  `void`
  `setDocumentMetadata(List<SearchDocumentKeyValueListPair> documentMetadata)`
  Set the documentMetadata of this `SearchFilter` instance.
  `void`
  `setId(String id)`
  Set the id of this `SearchFilter` instance.
  `Map<String,Object>`
  `toMap()`
  Get the value of all properties of this `SearchFilter` instance including unrecognized properties.
  `String`
  `toString()`

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

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

- ## Constructor Details

  - ### SearchFilter

    protected SearchFilter()
    Default constructor for SearchFilter.

- ## Method Details

  - ### id

    @Nonnull public SearchFilter id(@Nonnull String id)
    Set the id of this `SearchFilter` instance and return the same instance.
    Parameters:
      `id` - Identifier of this SearchFilter - unique per request.
    Returns:
      The same instance of this `SearchFilter` class

  - ### getId

    @Nonnull public String getId()
    Identifier of this SearchFilter - unique per request.
    Returns:
      id The id of this `SearchFilter` instance.

  - ### setId

    public void setId(@Nonnull String id)
    Set the id of this `SearchFilter` instance.
    Parameters:
      `id` - Identifier of this SearchFilter - unique per request.

  - ### collectionIds

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

  - ### addCollectionIdsItem

    @Nonnull public SearchFilter addCollectionIdsItem(@Nonnull String collectionIdsItem)
    Add one collectionIds instance to this `SearchFilter`.
    Parameters:
      `collectionIdsItem` - The collectionIds that should be added
    Returns:
      The same instance of type `SearchFilter`

  - ### getCollectionIds

    @Nonnull public List<String> getCollectionIds()
    Get collectionIds
    Returns:
      collectionIds The collectionIds of this `SearchFilter` instance.

  - ### setCollectionIds

    public void setCollectionIds(@Nonnull List<String> collectionIds)
    Set the collectionIds of this `SearchFilter` instance.
    Parameters:
      `collectionIds` - The collectionIds of this `SearchFilter`

  - ### _configuration

    @Nonnull public SearchFilter _configuration(@Nonnull SearchConfiguration _configuration)
    Set the _configuration of this `SearchFilter` instance and return the same instance.
    Parameters:
      `_configuration` - The _configuration of this `SearchFilter`
    Returns:
      The same instance of this `SearchFilter` class

  - ### getConfiguration

    @Nonnull public SearchConfiguration getConfiguration()
    Get _configuration
    Returns:
      _configuration The _configuration of this `SearchFilter` instance.

  - ### setConfiguration

    public void setConfiguration(@Nonnull SearchConfiguration _configuration)
    Set the _configuration of this `SearchFilter` instance.
    Parameters:
      `_configuration` - The _configuration of this `SearchFilter`

  - ### collectionMetadata

    @Nonnull public SearchFilter collectionMetadata(@Nullable List<KeyValueListPair> collectionMetadata)
    Set the collectionMetadata of this `SearchFilter` instance and return the same instance.
    Parameters:
      `collectionMetadata` - Restrict collections considered during search to those annotated with the given metadata. Useful when combined with collections=['*']
    Returns:
      The same instance of this `SearchFilter` class

  - ### addCollectionMetadataItem

    @Nonnull public SearchFilter addCollectionMetadataItem(@Nonnull KeyValueListPair collectionMetadataItem)
    Add one collectionMetadata instance to this `SearchFilter`.
    Parameters:
      `collectionMetadataItem` - The collectionMetadata that should be added
    Returns:
      The same instance of type `SearchFilter`

  - ### getCollectionMetadata

    @Nonnull public List<KeyValueListPair> getCollectionMetadata()
    Restrict collections considered during search to those annotated with the given metadata. Useful when combined with collections=['*']
    Returns:
      collectionMetadata The collectionMetadata of this `SearchFilter` instance.

  - ### setCollectionMetadata

    public void setCollectionMetadata(@Nullable List<KeyValueListPair> collectionMetadata)
    Set the collectionMetadata of this `SearchFilter` instance.
    Parameters:
      `collectionMetadata` - Restrict collections considered during search to those annotated with the given metadata. Useful when combined with collections=['*']

  - ### documentMetadata

    @Nonnull public SearchFilter documentMetadata(@Nullable List<SearchDocumentKeyValueListPair> documentMetadata)
    Set the documentMetadata of this `SearchFilter` instance and return the same instance.
    Parameters:
      `documentMetadata` - Restrict documents considered during search to those annotated with the given metadata.
    Returns:
      The same instance of this `SearchFilter` class

  - ### addDocumentMetadataItem

    @Nonnull public SearchFilter addDocumentMetadataItem(@Nonnull SearchDocumentKeyValueListPair documentMetadataItem)
    Add one documentMetadata instance to this `SearchFilter`.
    Parameters:
      `documentMetadataItem` - The documentMetadata that should be added
    Returns:
      The same instance of type `SearchFilter`

  - ### getDocumentMetadata

    @Nonnull public List<SearchDocumentKeyValueListPair> getDocumentMetadata()
    Restrict documents considered during search to those annotated with the given metadata.
    Returns:
      documentMetadata The documentMetadata of this `SearchFilter` instance.

  - ### setDocumentMetadata

    public void setDocumentMetadata(@Nullable List<SearchDocumentKeyValueListPair> documentMetadata)
    Set the documentMetadata of this `SearchFilter` instance.
    Parameters:
      `documentMetadata` - Restrict documents considered during search to those annotated with the given metadata.

  - ### chunkMetadata

    @Nonnull public SearchFilter chunkMetadata(@Nullable List<KeyValueListPair> chunkMetadata)
    Set the chunkMetadata of this `SearchFilter` instance and return the same instance.
    Parameters:
      `chunkMetadata` - Restrict chunks considered during search to those with the given metadata.
    Returns:
      The same instance of this `SearchFilter` class

  - ### addChunkMetadataItem

    @Nonnull public SearchFilter addChunkMetadataItem(@Nonnull KeyValueListPair chunkMetadataItem)
    Add one chunkMetadata instance to this `SearchFilter`.
    Parameters:
      `chunkMetadataItem` - The chunkMetadata that should be added
    Returns:
      The same instance of type `SearchFilter`

  - ### getChunkMetadata

    @Nonnull public List<KeyValueListPair> getChunkMetadata()
    Restrict chunks considered during search to those with the given metadata.
    Returns:
      chunkMetadata The chunkMetadata of this `SearchFilter` instance.

  - ### setChunkMetadata

    public void setChunkMetadata(@Nullable List<KeyValueListPair> chunkMetadata)
    Set the chunkMetadata of this `SearchFilter` instance.
    Parameters:
      `chunkMetadata` - Restrict chunks considered during search to those with the given metadata.

  - ### getCustomFieldNames

    @Nonnull public Set<String> getCustomFieldNames()
    Get the names of the unrecognizable properties of the `SearchFilter`.
    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 `SearchFilter` 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 `SearchFilter` 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 `SearchFilter` 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 SearchFilter.Builder create()
    Create a type-safe, fluent-api builder object to construct a new `SearchFilter` instance with all required arguments.