Record Class McpDispatcher.DispatchResult.Response

java.lang.Object
java.lang.Record
dev.tachyonmcp.core.server.McpDispatcher.DispatchResult.Response
Record Components:
responseBody - the encoded JSON-RPC response body
sessionId - the session id to echo back, if any
httpStatus - the real HTTP response status; JSON-RPC errors default to 200 per the JSON-RPC-over-HTTP convention (see JsonRpcError) — some protocol-level errors override it (e.g. 400/404)
All Implemented Interfaces:
McpDispatcher.DispatchResult
Enclosing interface:
McpDispatcher.DispatchResult

public static record McpDispatcher.DispatchResult.Response(byte[] responseBody, @Nullable String sessionId, int httpStatus) extends Record implements McpDispatcher.DispatchResult
A dispatched JSON-RPC response (result or error envelope) ready to write to the wire.
  • Constructor Details

    • Response

      public Response(byte[] responseBody, @Nullable String sessionId, int httpStatus)
      Creates an instance of a Response record class.
      Parameters:
      responseBody - the value for the responseBody record component
      sessionId - the value for the sessionId record component
      httpStatus - the value for the httpStatus record component
  • Method Details

    • responseBodyString

      public String responseBodyString()
    • 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. Reference components are compared with Objects::equals(Object,Object); primitive components are compared with '=='.
      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.
    • responseBody

      public byte[] responseBody()
      Returns the value of the responseBody record component.
      Returns:
      the value of the responseBody record component
    • sessionId

      public @Nullable String sessionId()
      Returns the value of the sessionId record component.
      Returns:
      the value of the sessionId record component
    • httpStatus

      public int httpStatus()
      Returns the value of the httpStatus record component.
      Returns:
      the value of the httpStatus record component