Record Class JsonRpcResponse
java.lang.Object
java.lang.Record
net.mcreator.io.mcp.protocol.JsonRpcResponse
public record JsonRpcResponse(String jsonrpc, com.google.gson.JsonElement result, JsonRpcResponse.JsonRpcError error, com.google.gson.JsonElement id)
extends Record
-
Nested Class Summary
Nested Classes -
Constructor Summary
ConstructorsConstructorDescriptionJsonRpcResponse(com.google.gson.JsonElement id, com.google.gson.JsonElement result) JsonRpcResponse(com.google.gson.JsonElement id, JsonRpcResponse.JsonRpcError error) JsonRpcResponse(String jsonrpc, com.google.gson.JsonElement result, JsonRpcResponse.JsonRpcError error, com.google.gson.JsonElement id) Creates an instance of aJsonRpcResponserecord class. -
Method Summary
Modifier and TypeMethodDescriptionfinal booleanIndicates whether some other object is "equal to" this one.error()Returns the value of theerrorrecord component.final inthashCode()Returns a hash code value for this object.com.google.gson.JsonElementid()Returns the value of theidrecord component.jsonrpc()Returns the value of thejsonrpcrecord component.com.google.gson.JsonElementresult()Returns the value of theresultrecord component.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
JsonRpcResponse
public JsonRpcResponse(String jsonrpc, com.google.gson.JsonElement result, JsonRpcResponse.JsonRpcError error, com.google.gson.JsonElement id) Creates an instance of aJsonRpcResponserecord class.- Parameters:
jsonrpc- the value for thejsonrpcrecord componentresult- the value for theresultrecord componenterror- the value for theerrorrecord componentid- the value for theidrecord component
-
JsonRpcResponse
public JsonRpcResponse(com.google.gson.JsonElement id, com.google.gson.JsonElement result) -
JsonRpcResponse
-
-
Method Details
-
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). -
jsonrpc
Returns the value of thejsonrpcrecord component.- Returns:
- the value of the
jsonrpcrecord component
-
result
public com.google.gson.JsonElement result()Returns the value of theresultrecord component.- Returns:
- the value of the
resultrecord component
-
error
Returns the value of theerrorrecord component.- Returns:
- the value of the
errorrecord component
-
id
public com.google.gson.JsonElement id()Returns the value of theidrecord component.- Returns:
- the value of the
idrecord component
-