Class TextContent
java.lang.Object
com.sap.ai.sdk.prompt.registry.model.TextContent
- All Implemented Interfaces:
MultiChatContent
TextContent
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic interfaceBuilder helper class.static interfaceBuilder helper class.static enumGets or Sets type -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic TextContent.Buildercreate()Create a type-safe, fluent-api builder object to construct a newTextContentinstance with all required arguments.booleangetCustomField(String name) Deprecated.Get the names of the unrecognizable properties of theTextContent.getText()Get textgetType()Get typeinthashCode()voidsetCustomField(String customFieldName, Object customFieldValue) Set an unrecognizable property of thisTextContentinstance.voidSet the text of thisTextContentinstance.voidsetType(TextContent.TypeEnum type) Set the type of thisTextContentinstance.Set the text of thisTextContentinstance and return the same instance.toMap()Get the value of all properties of thisTextContentinstance including unrecognized properties.toString()type(TextContent.TypeEnum type) Set the type of thisTextContentinstance and return the same instance.
-
Constructor Details
-
TextContent
protected TextContent()Default constructor for TextContent.
-
-
Method Details
-
type
Set the type of thisTextContentinstance and return the same instance.- Parameters:
type- The type of thisTextContent- Returns:
- The same instance of this
TextContentclass
-
getType
Get type- Returns:
- type The type of this
TextContentinstance.
-
setType
Set the type of thisTextContentinstance.- Parameters:
type- The type of thisTextContent
-
text
Set the text of thisTextContentinstance and return the same instance.- Parameters:
text- The text of thisTextContent- Returns:
- The same instance of this
TextContentclass
-
getText
Get text- Returns:
- text The text of this
TextContentinstance.
-
setText
Set the text of thisTextContentinstance.- Parameters:
text- The text of thisTextContent
-
getCustomFieldNames
Get the names of the unrecognizable properties of theTextContent.- 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 thisTextContentinstance.- 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 thisTextContentinstance including unrecognized properties.- Returns:
- The map of all properties
-
setCustomField
Set an unrecognizable property of thisTextContentinstance. 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 newTextContentinstance with all required arguments.
-
toMap()instead.