Record Class McpJsonRpcError
java.lang.Object
java.lang.Record
com.soklet.McpJsonRpcError
@Immutable
public record McpJsonRpcError(@NonNull Integer code, @NonNull String message)
extends Record
Immutable JSON-RPC error descriptor used by MCP request handling.
- Author:
- Mark Allen
-
Constructor Summary
ConstructorsConstructorDescriptionMcpJsonRpcError(@NonNull Integer code, @NonNull String message) Creates an instance of aMcpJsonRpcErrorrecord class. -
Method Summary
Modifier and TypeMethodDescriptioncode()Returns the value of thecoderecord component.final booleanIndicates whether some other object is "equal to" this one.static @NonNull McpJsonRpcErrorfromCodeAndMessage(@NonNull Integer code, @NonNull String message) Creates a JSON-RPC error descriptor from a code and message.final inthashCode()Returns a hash code value for this object.message()Returns the value of themessagerecord component.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
McpJsonRpcError
Creates an instance of aMcpJsonRpcErrorrecord class.- Parameters:
code- the value for thecoderecord componentmessage- the value for themessagerecord component
-
-
Method Details
-
fromCodeAndMessage
public static @NonNull McpJsonRpcError fromCodeAndMessage(@NonNull Integer code, @NonNull String message) Creates a JSON-RPC error descriptor from a code and message.- Parameters:
code- the JSON-RPC error codemessage- the JSON-RPC error message- Returns:
- a new JSON-RPC error descriptor
-
toString
-
hashCode
-
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). -
code
-
message
-