MethodParameter

data class MethodParameter(val name: String, val type: KClass<*>, val typeName: String, val annotations: List<AnnotationInfo>, val isNullable: Boolean)(source)

Describes a single parameter of an intercepted method.

Instances are created at compile time by the AspectK compiler plugin and embedded in the MethodSignature of each intercepted function. They give advice methods access to full type and annotation metadata for every parameter of the target function.

Generic type erasure: For parameters whose declared type is a generic type parameter (e.g., T), type and typeName are resolved to the type's upper bound at compile time (e.g., kotlin.Any for an unconstrained T, or the declared bound class for a bounded T : SomeClass).

Constructors

Link copied to clipboard
constructor(name: String, type: KClass<*>, typeName: String, annotations: List<AnnotationInfo>, isNullable: Boolean)

Properties

Link copied to clipboard

Metadata for all annotations present on this parameter.

Link copied to clipboard

true if the parameter type is nullable (e.g., String?).

Link copied to clipboard

The parameter name as declared in source code.

Link copied to clipboard
val type: KClass<*>

The erased KClass of the parameter type.

Link copied to clipboard

The fully-qualified class name of the parameter type as a String. Follows the same erasure rules as type.