Class Collection

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

public class Collection extends Object
A logical grouping of content.
  • Constructor Details

    • Collection

      protected Collection()
      Default constructor for Collection.
  • Method Details

    • title

      @Nonnull public Collection title(@Nullable String title)
      Set the title of this Collection instance and return the same instance.
      Parameters:
      title - The title of this Collection
      Returns:
      The same instance of this Collection class
    • getTitle

      @Nullable public String getTitle()
      Get title
      Returns:
      title The title of this Collection instance.
    • setTitle

      public void setTitle(@Nullable String title)
      Set the title of this Collection instance.
      Parameters:
      title - The title of this Collection
    • embeddingConfig

      @Nonnull public Collection embeddingConfig(@Nonnull EmbeddingConfig embeddingConfig)
      Set the embeddingConfig of this Collection instance and return the same instance.
      Parameters:
      embeddingConfig - The embeddingConfig of this Collection
      Returns:
      The same instance of this Collection class
    • getEmbeddingConfig

      @Nonnull public EmbeddingConfig getEmbeddingConfig()
      Get embeddingConfig
      Returns:
      embeddingConfig The embeddingConfig of this Collection instance.
    • setEmbeddingConfig

      public void setEmbeddingConfig(@Nonnull EmbeddingConfig embeddingConfig)
      Set the embeddingConfig of this Collection instance.
      Parameters:
      embeddingConfig - The embeddingConfig of this Collection
    • metadata

      @Nonnull public Collection metadata(@Nullable List<VectorKeyValueListPair> metadata)
      Set the metadata of this Collection instance and return the same instance.
      Parameters:
      metadata - Metadata attached to collection. Useful to restrict search to a subset of collections.
      Returns:
      The same instance of this Collection class
    • addMetadataItem

      @Nonnull public Collection addMetadataItem(@Nonnull VectorKeyValueListPair metadataItem)
      Add one metadata instance to this Collection.
      Parameters:
      metadataItem - The metadata that should be added
      Returns:
      The same instance of type Collection
    • getMetadata

      @Nonnull public List<VectorKeyValueListPair> getMetadata()
      Metadata attached to collection. Useful to restrict search to a subset of collections.
      Returns:
      metadata The metadata of this Collection instance.
    • setMetadata

      public void setMetadata(@Nullable List<VectorKeyValueListPair> metadata)
      Set the metadata of this Collection instance.
      Parameters:
      metadata - Metadata attached to collection. Useful to restrict search to a subset of collections.
    • id

      @Nonnull public Collection id(@Nonnull UUID id)
      Set the id of this Collection instance and return the same instance.
      Parameters:
      id - Unique identifier of a collection.
      Returns:
      The same instance of this Collection class
    • getId

      @Nonnull public UUID getId()
      Unique identifier of a collection.
      Returns:
      id The id of this Collection instance.
    • setId

      public void setId(@Nonnull UUID id)
      Set the id of this Collection instance.
      Parameters:
      id - Unique identifier of a collection.
    • getCustomFieldNames

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