Record Class JsonRpcMessage.Response
java.lang.Object
java.lang.Record
dev.tachyonmcp.core.transport.jsonrpc.JsonRpcMessage.Response
- Record Components:
id- the request identifier being responded to, ornullresultJson- the JSON-encoded result payload
- All Implemented Interfaces:
JsonRpcMessage
- Enclosing interface:
JsonRpcMessage
public static record JsonRpcMessage.Response(@Nullable RequestId id, String resultJson)
extends Record
implements JsonRpcMessage
A JSON-RPC success response.
-
Nested Class Summary
Nested classes/interfaces inherited from interface dev.tachyonmcp.core.transport.jsonrpc.JsonRpcMessage
JsonRpcMessage.Error, JsonRpcMessage.Notification<T>, JsonRpcMessage.Request<T>, JsonRpcMessage.Response -
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.@Nullable RequestIdid()Returns the value of theidrecord component.Returns the value of theresultJsonrecord component.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
Response
Creates an instance of aResponserecord class.- Parameters:
id- the value for theidrecord componentresultJson- the value for theresultJsonrecord component
-
-
Method Details
-
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). -
id
Returns the value of theidrecord component.- Specified by:
idin interfaceJsonRpcMessage- Returns:
- the value of the
idrecord component
-
resultJson
Returns the value of theresultJsonrecord component.- Returns:
- the value of the
resultJsonrecord component
-