Package dev.tachyonmcp.core.server
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 bodysessionId- the session id to echo back, if anyhttpStatus- the real HTTP response status; JSON-RPC errors default to200per the JSON-RPC-over-HTTP convention (seeJsonRpcError) — 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.
-
Nested Class Summary
Nested classes/interfaces inherited from interface dev.tachyonmcp.core.server.McpDispatcher.DispatchResult
McpDispatcher.DispatchResult.Accepted, McpDispatcher.DispatchResult.Response, McpDispatcher.DispatchResult.Status -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionfinal booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.intReturns the value of thehttpStatusrecord component.byte[]Returns the value of theresponseBodyrecord component.@Nullable StringReturns the value of thesessionIdrecord component.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
Response
Creates an instance of aResponserecord class.- Parameters:
responseBody- the value for theresponseBodyrecord componentsessionId- the value for thesessionIdrecord componenthttpStatus- the value for thehttpStatusrecord component
-
-
Method Details
-
responseBodyString
-
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. Reference components are compared withObjects::equals(Object,Object); primitive components are compared with '=='. -
responseBody
public byte[] responseBody()Returns the value of theresponseBodyrecord component.- Returns:
- the value of the
responseBodyrecord component
-
sessionId
Returns the value of thesessionIdrecord component.- Returns:
- the value of the
sessionIdrecord component
-
httpStatus
public int httpStatus()Returns the value of thehttpStatusrecord component.- Returns:
- the value of the
httpStatusrecord component
-