MethodMetadata

data class MethodMetadata(val annotationFqName: String, val arguments: List<Pair<String, MetadataValue>>)

A captured sibling annotation on a @KsMethod function.

The ksrpc compiler plugin walks every annotation on a @KsMethod function whose annotation class is itself annotated with com.monkopedia.ksrpc.annotation.KsMethodMetadata, decodes its arguments into MetadataValues, and attaches a MethodMetadata entry to the generated RpcMethod. Transport layers can then look the metadata up by annotationFqName when serializing a call.

The container is intentionally generic — older ksrpc versions reading a descriptor produced by a newer version see unfamiliar metadata entries as opaque MethodMetadata objects rather than failing. Consumers that don't know the annotation can ignore it; consumers that do know it can decode the arguments by name.

Constructors

Link copied to clipboard
constructor(annotationFqName: String, arguments: List<Pair<String, MetadataValue>>)

Properties

Link copied to clipboard

the fully qualified name of the captured annotation class, e.g. com.example.MyMarker.

Link copied to clipboard

the captured annotation arguments, in declaration order, each as a name → MetadataValue pair. Default-valued arguments that the call site does not specify are not represented.

Functions

Link copied to clipboard

Look up the value of the argument with name, or null if no such argument was captured.

Link copied to clipboard
open override fun toString(): String