Skip to content

//core/io.github.serpro69.kfaker.provider.misc/ParameterInfo

ParameterInfo

[jvm]\ data class ParameterInfo(val index: Int, val name: String, val isOptional: Boolean, val isVararg: Boolean, val type: KType, val kind: KParameter.Kind)

Provides additional information about Class parameter to custom defined generators. The reason why KParameter is not used is that you will want to provide additional information about parameter that is not available in KParameter class.

Constructors

ParameterInfo [jvm]
constructor(index: Int, name: String, isOptional: Boolean, isVararg: Boolean, type: KType, kind: KParameter.Kind)

Properties

Name Summary
index [jvm]
val index: Int
0-based index of this parameter in the parameter list of its containing callable.
isOptional [jvm]
val isOptional: Boolean
true if this parameter is optional and can be omitted when making a call via KCallable.callBy, or false otherwise.
isVararg [jvm]
val isVararg: Boolean
true if this parameter is vararg. See the Kotlin language documentation for more information.
kind [jvm]
val kind: KParameter.Kind
Kind of this parameter. Kind represents a particular position of the parameter declaration in the source code, such as an instance, an extension receiver parameter or a value parameter.
name [jvm]
val name: String
Name of this parameter as it was declared in the source code, or null if the parameter has no name or its name is not available at runtime. Examples of nameless parameters include this instance for member functions, extension receiver for extension functions or properties, parameters of Java methods compiled without the debug information, and others.
type [jvm]
val type: KType
Type of this parameter. For a vararg parameter, this is the type of the corresponding array, not the individual element.