All Downloads are FREE. Search and download functionalities are using the official Maven repository.

dev.mokkery.plugin.ir.FqName.kt Maven / Gradle / Ivy

Go to download

Mokkery is a mocking library for Kotlin Multiplatform, easy to use, boilerplate-free and compiler plugin driven.

The newest version!
package dev.mokkery.plugin.ir

import org.jetbrains.kotlin.name.CallableId
import org.jetbrains.kotlin.name.FqName
import org.jetbrains.kotlin.name.Name
import kotlin.properties.PropertyDelegateProvider
import kotlin.properties.ReadOnlyProperty

val fqName: PropertyDelegateProvider>
    get() = PropertyDelegateProvider { _: Any?, property ->
        val name = FqName(property.name.replace("_", "."))
        ReadOnlyProperty { _, _ -> name }
    }


val FqName.functionId: PropertyDelegateProvider>
    get() = PropertyDelegateProvider { _: Any?, property ->
        val id = CallableId(this, Name.identifier(property.name))
        ReadOnlyProperty { _, _ -> id }
    }
val FqName.fqName: PropertyDelegateProvider>
    get() = PropertyDelegateProvider { _: Any?, property ->
        val name = child(Name.identifier(property.name))
        ReadOnlyProperty { _, _ -> name }
    }




© 2015 - 2024 Weber Informatics LLC | Privacy Policy