Interface RequestId

All Known Implementing Classes:
RequestId.NumericValue, RequestId.StringValue

public sealed interface RequestId permits RequestId.StringValue, RequestId.NumericValue
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 Classes
    Modifier and Type
    Interface
    Description
    static final record 
    An id carrying a numeric value.
    static final record 
    An id carrying a string value.
  • Method Summary

    Static Methods
    Modifier and Type
    Method
    Description
    static RequestId
    of(Object value)
    Wraps a raw value as a RequestId.
    static @Nullable RequestId
    ofNullable(@Nullable Object value)
    Wraps a raw value as a RequestId, passing through null — for the JSON-RPC id field, which is legitimately absent on notifications and some error responses.