Package io.micronaut.mcp.jsonrpc
Record Class SuccessfulResponse<R,I>
java.lang.Object
java.lang.Record
io.micronaut.mcp.jsonrpc.SuccessfulResponse<R,I>
- Type Parameters:
R
- The type of the result field.I
- The type of the id field (String, Number, or null).- Record Components:
jsonrpc
- Version of the JSON-RPC protocol.result
- The value is determined by the method invoked on the Server.id
- This member is REQUIRED. It MUST be the same as the value of the id member in the Request Object. If there was an error in detecting the id in the Request object, it MUST be Null.
JSON-RPC Successful Response.
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionSuccessfulResponse
(@NonNull String jsonrpc, R result, I id) Creates an instance of aSuccessfulResponse
record class.SuccessfulResponse
(R result, I id) -
Method Summary
Modifier and TypeMethodDescriptionfinal boolean
Indicates whether some other object is "equal to" this one.final int
hashCode()
Returns a hash code value for this object.id()
Returns the value of theid
record component.@NonNull String
jsonrpc()
Returns the value of thejsonrpc
record component.result()
Returns the value of theresult
record component.final String
toString()
Returns a string representation of this record class.
-
Constructor Details
-
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)
. -
jsonrpc
Returns the value of thejsonrpc
record component.- Returns:
- the value of the
jsonrpc
record component
-
result
Returns the value of theresult
record component.- Returns:
- the value of the
result
record component
-
id
Returns the value of theid
record component.- Returns:
- the value of the
id
record component
-