Package io.modelcontextprotocol.spec
Record Class McpSchema.TextContent
java.lang.Object
java.lang.Record
io.modelcontextprotocol.spec.McpSchema.TextContent
- Record Components:
annotations- Optional annotations for the clienttext- The text content of the messagemeta- See specification for notes on _meta usage
- All Implemented Interfaces:
McpSchema.Annotated,McpSchema.Content
- Enclosing class:
- McpSchema
public static record McpSchema.TextContent(McpSchema.Annotations annotations, String text, Map<String,Object> meta)
extends Record
implements McpSchema.Annotated, McpSchema.Content
Text provided to or from an LLM.
-
Constructor Summary
ConstructorsConstructorDescriptionTextContent(McpSchema.Annotations annotations, String text) TextContent(McpSchema.Annotations annotations, String text, Map<String, Object> meta) Creates an instance of aTextContentrecord class.TextContent(String content) TextContent(List<McpSchema.Role> audience, Double priority, String content) Deprecated.Only exists for backwards-compatibility purposes. -
Method Summary
Modifier and TypeMethodDescriptionReturns the value of theannotationsrecord component.audience()Deprecated.Only exists for backwards-compatibility purposes.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.meta()Returns the value of themetarecord component.priority()Deprecated.Only exists for backwards-compatibility purposes.text()Returns the value of thetextrecord component.final StringtoString()Returns a string representation of this record class.Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface io.modelcontextprotocol.spec.McpSchema.Content
type
-
Constructor Details
-
TextContent
-
TextContent
-
TextContent
Deprecated.Only exists for backwards-compatibility purposes. UseTextContent(Annotations, String)instead. -
TextContent
Creates an instance of aTextContentrecord class.- Parameters:
annotations- the value for theannotationsrecord componenttext- the value for thetextrecord componentmeta- the value for themetarecord component
-
-
Method Details
-
audience
Deprecated.Only exists for backwards-compatibility purposes. Useannotations()instead. -
priority
Deprecated.Only exists for backwards-compatibility purposes. Useannotations()instead. -
toString
Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components. -
hashCode
public final int hashCode()Returns a hash code value for this object. The value is derived from the hash code of each of the record components. -
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared withObjects::equals(Object,Object). -
annotations
Returns the value of theannotationsrecord component.- Specified by:
annotationsin interfaceMcpSchema.Annotated- Returns:
- the value of the
annotationsrecord component
-
text
Returns the value of thetextrecord component.- Returns:
- the value of the
textrecord component
-
meta
Returns the value of themetarecord component.- Specified by:
metain interfaceMcpSchema.Content- Returns:
- the value of the
metarecord component
-