Package io.micronaut.mcp.jsonrpc
Record Class Request<P,I>
java.lang.Object
java.lang.Record
io.micronaut.mcp.jsonrpc.Request<P,I>
- Type Parameters:
P
- The type of the params field.I
- The type of the id field (String, Number, or null).- Record Components:
jsonrpc
- Version of the JSON-RPC protocol.method
- A String containing the name of the method to be invoked.params
- A Structured value that holds the parameter values to be used during the invocation of the method.id
- An identifier established by the Client that MUST contain a String, Number, or NULL value if included. If it is not included it is assumed to be a notification. The value SHOULD normally not be Null and Numbers SHOULD NOT contain fractional parts.
public record Request<P,I> (@Pattern(regexp="2\\.0") @NotBlank @NonNull String jsonrpc, @NotBlank @NonNull String method, P params, I id)
extends Record
JSON-RPC Request.
- See Also:
-
Field Summary
Fields -
Constructor Summary
Constructors -
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.@Pattern(regexp="2\\.0") @NotBlank @NonNull String
jsonrpc()
Returns the value of thejsonrpc
record component.@NotBlank @NonNull String
method()
Returns the value of themethod
record component.params()
Returns the value of theparams
record component.final String
toString()
Returns a string representation of this record class.
-
Field Details
-
VERSION_2_0
- See Also:
-
-
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
@Pattern(regexp="2\\.0") @NotBlank @NonNull public @Pattern(regexp="2\\.0") @NotBlank @NonNull String jsonrpc()Returns the value of thejsonrpc
record component.- Returns:
- the value of the
jsonrpc
record component
-
method
Returns the value of themethod
record component.- Returns:
- the value of the
method
record component
-
params
Returns the value of theparams
record component.- Returns:
- the value of the
params
record component
-
id
Returns the value of theid
record component.- Returns:
- the value of the
id
record component
-