Class McpRequestId
java.lang.Object
com.soklet.McpRequestId
An immutable MCP JSON-RPC request identifier.
- Author:
- Mark Allen
-
Method Summary
Modifier and TypeMethodDescriptionReturns the numeric representation when this is an integer request ID.asString()Returns the string representation when this is a string request ID.booleanCompares request IDs by wire type and value.static @NonNull McpRequestIdfromInteger(@NonNull BigInteger value) Creates a request identifier from its integral numeric wire value.static @NonNull McpRequestIdfromString(@NonNull String value) Creates a request identifier from its string wire value.inthashCode()Returns a hash code derived from the request ID's wire type and value.toString()Returns a redacted diagnostic representation that preserves only the MCP wire type.
-
Method Details
-
fromString
Creates a request identifier from its string wire value.- Parameters:
value- the string identifier- Returns:
- the request identifier
-
fromInteger
Creates a request identifier from its integral numeric wire value.- Parameters:
value- the integral identifier- Returns:
- the request identifier
-
asString
-
asInteger
Returns the numeric representation when this is an integer request ID.- Returns:
- the integer value, or the empty optional for a string request ID
-
equals
-
hashCode
-
toString
Returns a redacted diagnostic representation that preserves only the MCP wire type. Request identifiers are client-supplied and may contain secrets or high-cardinality values; useasString()orasInteger()only when exact application processing requires them.
-