Package dev.tachyonmcp.api.server.domain
Interface RequestId
- All Known Implementing Classes:
RequestId.NumericValue,RequestId.StringValue
A JSON-RPC 2.0 request/response id: a bare JSON string or number, never an object or array. See
of(Object) and ofNullable(Object) for how raw wire values map to this type.-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic final recordAn id carrying a numeric value.static final recordAn id carrying a string value. -
Method Summary
Static MethodsModifier and TypeMethodDescriptionstatic RequestIdWraps a raw value as aRequestId.static @Nullable RequestIdofNullable(@Nullable Object value) Wraps a raw value as aRequestId, passing throughnull— for the JSON-RPCidfield, which is legitimately absent on notifications and some error responses.
-
Method Details
-
of
Wraps a raw value as aRequestId.- Parameters:
value- aCharSequenceorNumber- Returns:
- the wrapped id
- Throws:
IllegalArgumentException- ifvalueis neither aCharSequencenor aNumber
-
ofNullable
Wraps a raw value as aRequestId, passing throughnull— for the JSON-RPCidfield, which is legitimately absent on notifications and some error responses.- Parameters:
value- aCharSequence,Number, ornull- Returns:
- the wrapped id, or
nullifvaluewasnull - Throws:
IllegalArgumentException- ifvalueis non-null and neither aCharSequencenor aNumber
-