Package com.sap.ai.sdk.grounding.model
Class Document
java.lang.Object
com.sap.ai.sdk.grounding.model.Document
Document
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic interfaceBuilder helper class.static interfaceBuilder helper class. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionaddChunksItem(RetrievalChunk chunksItem) Add one chunks instance to thisDocument.addMetadataItem(RetrievalDocumentKeyValueListPair metadataItem) Add one metadata instance to thisDocument.chunks(List<RetrievalChunk> chunks) Set the chunks of thisDocumentinstance and return the same instance.static Document.Buildercreate()Create a type-safe, fluent-api builder object to construct a newDocumentinstance with all required arguments.booleanGet chunksgetCustomField(String name) Deprecated.Get the names of the unrecognizable properties of theDocument.getId()Get idGet metadatainthashCode()Set the id of thisDocumentinstance and return the same instance.metadata(List<RetrievalDocumentKeyValueListPair> metadata) Set the metadata of thisDocumentinstance and return the same instance.voidsetChunks(List<RetrievalChunk> chunks) Set the chunks of thisDocumentinstance.voidsetCustomField(String customFieldName, Object customFieldValue) Set an unrecognizable property of thisDocumentinstance.voidSet the id of thisDocumentinstance.voidsetMetadata(List<RetrievalDocumentKeyValueListPair> metadata) Set the metadata of thisDocumentinstance.toMap()Get the value of all properties of thisDocumentinstance including unrecognized properties.toString()
-
Constructor Details
-
Document
protected Document()Default constructor for Document.
-
-
Method Details
-
id
Set the id of thisDocumentinstance and return the same instance. -
getId
Get id- Returns:
- id The id of this
Documentinstance.
-
setId
Set the id of thisDocumentinstance.- Parameters:
id- The id of thisDocument
-
metadata
Set the metadata of thisDocumentinstance and return the same instance. -
addMetadataItem
Add one metadata instance to thisDocument.- Parameters:
metadataItem- The metadata that should be added- Returns:
- The same instance of type
Document
-
getMetadata
Get metadata- Returns:
- metadata The metadata of this
Documentinstance.
-
setMetadata
Set the metadata of thisDocumentinstance.- Parameters:
metadata- The metadata of thisDocument
-
chunks
Set the chunks of thisDocumentinstance and return the same instance. -
addChunksItem
Add one chunks instance to thisDocument.- Parameters:
chunksItem- The chunks that should be added- Returns:
- The same instance of type
Document
-
getChunks
Get chunks- Returns:
- chunks The chunks of this
Documentinstance.
-
setChunks
Set the chunks of thisDocumentinstance.- Parameters:
chunks- The chunks of thisDocument
-
getCustomFieldNames
Get the names of the unrecognizable properties of theDocument.- 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 thisDocumentinstance.- 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 thisDocumentinstance including unrecognized properties.- Returns:
- The map of all properties
-
setCustomField
Set an unrecognizable property of thisDocumentinstance. 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 newDocumentinstance with all required arguments.
-
toMap()instead.