Package com.tnsai.mcp.server
Record Class McpRequestHandler.HandlerResult.Error
java.lang.Object
java.lang.Record
com.tnsai.mcp.server.McpRequestHandler.HandlerResult.Error
- Record Components:
httpStatus- suggested HTTP status code (e.g. 400 for parse errors)jsonRpc- the JSON-RPC error response string
- All Implemented Interfaces:
McpRequestHandler.HandlerResult
- Enclosing interface:
McpRequestHandler.HandlerResult
public static record McpRequestHandler.HandlerResult.Error(int httpStatus, String jsonRpc)
extends Record
implements McpRequestHandler.HandlerResult
An error occurred during processing.
-
Nested Class Summary
Nested classes/interfaces inherited from interface com.tnsai.mcp.server.McpRequestHandler.HandlerResult
McpRequestHandler.HandlerResult.Error, McpRequestHandler.HandlerResult.Notification, McpRequestHandler.HandlerResult.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.intReturns the value of thehttpStatusrecord component.jsonRpc()Returns the value of thejsonRpcrecord component.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
Error
Creates an instance of aErrorrecord class.- Parameters:
httpStatus- the value for thehttpStatusrecord componentjsonRpc- the value for thejsonRpcrecord 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. Reference components are compared withObjects::equals(Object,Object); primitive components are compared with '=='. -
httpStatus
public int httpStatus()Returns the value of thehttpStatusrecord component.- Returns:
- the value of the
httpStatusrecord component
-
jsonRpc
Returns the value of thejsonRpcrecord component.- Returns:
- the value of the
jsonRpcrecord component
-