Record Class McpJsonRpcRequestId
java.lang.Object
java.lang.Record
com.soklet.McpJsonRpcRequestId
Immutable wrapper for JSON-RPC request identifiers.
- Author:
- Mark Allen
-
Constructor Summary
ConstructorsConstructorDescriptionMcpJsonRpcRequestId(@NonNull McpValue value) Creates an instance of aMcpJsonRpcRequestIdrecord class. -
Method Summary
Modifier and TypeMethodDescriptionasNumber()Reads the request ID as a number when it is number-backed.asString()Reads the request ID as a string when it is string-backed.final booleanIndicates whether some other object is "equal to" this one.static @NonNull McpJsonRpcRequestIdfromNumber(@NonNull BigDecimal value) Creates a number-backed JSON-RPC request ID.static @NonNull McpJsonRpcRequestIdfromString(@NonNull String value) Creates a string-backed JSON-RPC request ID.final inthashCode()Returns a hash code value for this object.final StringtoString()Returns a string representation of this record class.value()Returns the value of thevaluerecord component.
-
Constructor Details
-
McpJsonRpcRequestId
Creates an instance of aMcpJsonRpcRequestIdrecord class.- Parameters:
value- the value for thevaluerecord component
-
-
Method Details
-
fromString
Creates a string-backed JSON-RPC request ID.- Parameters:
value- the string request ID- Returns:
- the request ID wrapper
-
fromNumber
Creates a number-backed JSON-RPC request ID.- Parameters:
value- the numeric request ID- Returns:
- the request ID wrapper
-
asString
-
asNumber
Reads the request ID as a number when it is number-backed.- Returns:
- the numeric request ID, if this wrapper holds one
-
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). -
value
-