Package io.moderne.jsonrpc
Class RawJson
java.lang.Object
io.moderne.jsonrpc.RawJson
Library-owned wrapper for the
params, result, and inbound
error JSON values on JSON-RPC messages. Holds either:
- a POJO (outbound — wrapped at request construction, serialized
through whatever the
MessageFormatteruses on the wire), or - a parser-format-specific buffer (inbound — produced by the formatter
during
deserialize; converted lazily to a typed POJO when the consumer asks viaas(MessageFormatter, Class)), or null.
-
Nested Class Summary
Nested Classes -
Method Summary
Modifier and TypeMethodDescription<T> @Nullable Tas(MessageFormatter formatter, Class<T> type) Convert this value totypeusingformatter.<T> @Nullable Tas(MessageFormatter formatter, Type type) booleanisNull()static RawJsonWrap an arbitrary value.@Nullable Objectunwrap()Internal accessor forMessageFormatterimplementations and the default Jackson serializer.
-
Method Details
-
of
Wrap an arbitrary value.nullreturns the canonical null instance (no allocation per call). -
isNull
public boolean isNull() -
as
Convert this value totypeusingformatter. ReturnsnullwhenisNull(); otherwise delegates toMessageFormatter.convertValue(RawJson, Type). -
as
-
unwrap
Internal accessor forMessageFormatterimplementations and the default Jackson serializer. Returns the wrapped value (POJO, parser buffer, ornull). Library consumers should useas(MessageFormatter, Class)instead — callingunwrap()directly couples them to the wire format.
-