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

com.lemonappdev.konsist.core.util.ParentUtil.kt Maven / Gradle / Ivy

Go to download

A Kotlin architecture test library. Define and guard code base consistency using Kotlin.

The newest version!
package com.lemonappdev.konsist.core.util

import com.lemonappdev.konsist.api.declaration.KoParentDeclaration
import com.lemonappdev.konsist.api.provider.KoFullyQualifiedNameProvider
import kotlin.reflect.KClass

object ParentUtil {
    internal fun  checkIfParentOf(
        kClass: KClass<*>,
        list: List,
    ): Boolean =
        list.any { parent ->
            (parent.sourceDeclaration as? KoFullyQualifiedNameProvider)?.fullyQualifiedName == kClass.qualifiedName
        }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy