Package-level declarations

Types

Link copied to clipboard
Link copied to clipboard

Thrown if ore than one qualifier annotation is found on a given class.

Link copied to clipboard
class TypeTokenResolutionError(referencedType: KType, context: TypeToken<*>) : AssertionError

Thrown when an error occurs while trying to resolve a KType into a concrete TypeToken

Functions

Link copied to clipboard
expect fun KClass<*>.allConstructors(): List<KFunction<*>>

Returns a list of all constructors for a KClass

actual fun KClass<*>.allConstructors(): List<KFunction<*>>
Link copied to clipboard

Return the Class for this TypeToken.

Link copied to clipboard

Return the KClass for this TypeToken. Class is not typed to ensure support for TypeTokens of nullable types.

Link copied to clipboard
expect fun KFunction<*>.callWith(vararg args: Any?): Any?

Call the receiver KFunction with the provided args

actual fun KFunction<*>.callWith(vararg args: Any?): Any?
Link copied to clipboard
expect fun KClass<*>.createConcreteType(arguments: List<KTypeProjection>, nullable: Boolean): KType

Creates a concrete type of the receiver KClass using the provided arguments to fill in any type parameters.

actual fun KClass<*>.createConcreteType(arguments: List<KTypeProjection>, nullable: Boolean): KType
Link copied to clipboard
fun List<Annotation>.findQualifier(errorContext: () -> String): Annotation?

Returns the single qualifier in the receiver list if there is one. Throws a MultipleQualifierError if there is more than one qualifier.

Link copied to clipboard

Returns true if the receiver is a qualifier annotation

Link copied to clipboard
expect fun KFunction<*>.parameterCount(): Int

Returns the number of parameters for a given KFunction

actual fun KFunction<*>.parameterCount(): Int
Link copied to clipboard
expect fun KFunction<*>.parameterKeys(context: TypeToken<*>): List<DependencyKey<*>>

Returns a list of DependencyKeys that represent the parameters of the receiver KFunction.

actual fun KFunction<*>.parameterKeys(context: TypeToken<*>): List<DependencyKey<*>>
Link copied to clipboard
expect fun KClass<*>.primaryConstructor(): KFunction<*>

Returns the primary constructor for a KClass

actual fun KClass<*>.primaryConstructor(): KFunction<*>
Link copied to clipboard
fun TypeToken<*>.resolveJvmType(jvmType: Type, declaringClass: Class<*>): TypeToken<*>

Returns a concrete TypeToken representing the given jvmType.

Link copied to clipboard
fun TypeToken<*>.resolveType(referencedType: KType): TypeToken<*>

Returns a concrete TypeToken representing the referencedType using the receiver as context.

Link copied to clipboard

Tries to make a KFunction accessible if it is not already

Link copied to clipboard

Returns a list of type parameters for the receiver KClass