Record Class McpConnectionInfo

java.lang.Object
java.lang.Record
org.springframework.ai.mcp.McpConnectionInfo
Record Components:
clientCapabilities - the MCP client capabilities
clientInfo - the MCP client information
initializeResult - the MCP server initialization result

public record McpConnectionInfo(io.modelcontextprotocol.spec.McpSchema.ClientCapabilities clientCapabilities, io.modelcontextprotocol.spec.McpSchema.Implementation clientInfo, io.modelcontextprotocol.spec.McpSchema.InitializeResult initializeResult) extends Record
MCP connection info record containing the client and server related metadata.
Author:
Ilayaperumal Gopinathan, Christian Tzolov
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Class
    Description
    static final class 
    Builder class for constructing McpConnectionInfo instances.
  • Constructor Summary

    Constructors
    Constructor
    Description
    McpConnectionInfo(io.modelcontextprotocol.spec.McpSchema.ClientCapabilities clientCapabilities, io.modelcontextprotocol.spec.McpSchema.Implementation clientInfo, io.modelcontextprotocol.spec.McpSchema.InitializeResult initializeResult)
    Creates an instance of a McpConnectionInfo record class.
  • Method Summary

    Modifier and Type
    Method
    Description
    Creates a new Builder instance for constructing McpConnectionInfo.
    io.modelcontextprotocol.spec.McpSchema.ClientCapabilities
    Returns the value of the clientCapabilities record component.
    io.modelcontextprotocol.spec.McpSchema.Implementation
    Returns the value of the clientInfo record component.
    final boolean
    Indicates whether some other object is "equal to" this one.
    final int
    Returns a hash code value for this object.
    io.modelcontextprotocol.spec.McpSchema.InitializeResult
    Returns the value of the initializeResult record component.
    final String
    Returns a string representation of this record class.

    Methods inherited from class java.lang.Object

    clone, finalize, getClass, notify, notifyAll, wait, wait, wait
  • Constructor Details

    • McpConnectionInfo

      public McpConnectionInfo(io.modelcontextprotocol.spec.McpSchema.ClientCapabilities clientCapabilities, io.modelcontextprotocol.spec.McpSchema.Implementation clientInfo, io.modelcontextprotocol.spec.McpSchema.InitializeResult initializeResult)
      Creates an instance of a McpConnectionInfo record class.
      Parameters:
      clientCapabilities - the value for the clientCapabilities record component
      clientInfo - the value for the clientInfo record component
      initializeResult - the value for the initializeResult record component
  • Method Details

    • builder

      public static McpConnectionInfo.Builder builder()
      Creates a new Builder instance for constructing McpConnectionInfo.
      Returns:
      a new Builder instance
    • toString

      public final String 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.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • 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.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      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 with Objects::equals(Object,Object).
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • clientCapabilities

      public io.modelcontextprotocol.spec.McpSchema.ClientCapabilities clientCapabilities()
      Returns the value of the clientCapabilities record component.
      Returns:
      the value of the clientCapabilities record component
    • clientInfo

      public io.modelcontextprotocol.spec.McpSchema.Implementation clientInfo()
      Returns the value of the clientInfo record component.
      Returns:
      the value of the clientInfo record component
    • initializeResult

      public io.modelcontextprotocol.spec.McpSchema.InitializeResult initializeResult()
      Returns the value of the initializeResult record component.
      Returns:
      the value of the initializeResult record component