Package com.sap.ai.sdk.grounding.model
Class Chunk
java.lang.Object
com.sap.ai.sdk.grounding.model.Chunk
Chunk
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic interfaceBuilder helper class.static interfaceBuilder helper class. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionaddMetadataItem(KeyValueListPair metadataItem) Add one metadata instance to thisChunk.Set the content of thisChunkinstance and return the same instance.static Chunk.Buildercreate()Create a type-safe, fluent-api builder object to construct a newChunkinstance with all required arguments.booleanGet contentgetCustomField(String name) Deprecated.Get the names of the unrecognizable properties of theChunk.getId()Get idGet metadatainthashCode()Set the id of thisChunkinstance and return the same instance.metadata(List<KeyValueListPair> metadata) Set the metadata of thisChunkinstance and return the same instance.voidsetContent(String content) Set the content of thisChunkinstance.voidsetCustomField(String customFieldName, Object customFieldValue) Set an unrecognizable property of thisChunkinstance.voidSet the id of thisChunkinstance.voidsetMetadata(List<KeyValueListPair> metadata) Set the metadata of thisChunkinstance.toMap()Get the value of all properties of thisChunkinstance including unrecognized properties.toString()
-
Constructor Details
-
Chunk
protected Chunk()Default constructor for Chunk.
-
-
Method Details
-
id
Set the id of thisChunkinstance and return the same instance. -
getId
Get id- Returns:
- id The id of this
Chunkinstance.
-
setId
Set the id of thisChunkinstance.- Parameters:
id- The id of thisChunk
-
content
Set the content of thisChunkinstance and return the same instance. -
getContent
Get content- Returns:
- content The content of this
Chunkinstance.
-
setContent
Set the content of thisChunkinstance.- Parameters:
content- The content of thisChunk
-
metadata
Set the metadata of thisChunkinstance and return the same instance. -
addMetadataItem
Add one metadata instance to thisChunk.- Parameters:
metadataItem- The metadata that should be added- Returns:
- The same instance of type
Chunk
-
getMetadata
Get metadata- Returns:
- metadata The metadata of this
Chunkinstance.
-
setMetadata
Set the metadata of thisChunkinstance.- Parameters:
metadata- The metadata of thisChunk
-
getCustomFieldNames
Get the names of the unrecognizable properties of theChunk.- 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 thisChunkinstance.- 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 thisChunkinstance including unrecognized properties.- Returns:
- The map of all properties
-
setCustomField
Set an unrecognizable property of thisChunkinstance. 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 newChunkinstance with all required arguments.
-
toMap()instead.