hasAllParentsOf

abstract fun hasAllParentsOf(name: KClass<*>, vararg names: KClass<*>, indirectParents: Boolean = false): Boolean

Determines whether the declaration has parents with all the specified KClass type.

Return

true if the declaration has parents of all the specified KClass types, false otherwise.

Parameters

name

the KClass type of the parent to check.

names

the KClass types of the parents to check.

indirectParents

specifies whether to include parents defined in other files such as parent of the parent. If true, it includes only those parents defined within our scope and those used by our declarations. For example:

// Android
class AppCompactActivity: Activity
interface Activity

// Project
class BaseActivity: AppCompactActivity() // parents(indirectParents = true) returns [AppCompactActivity]
class MyActivity: BaseActivity() // parents(indirectParents = true) returns [BaseActivity, AppCompactActivity]

abstract fun hasAllParentsOf(names: Collection<KClass<*>>, indirectParents: Boolean = false): Boolean

Determines whether the declaration has parents with all the specified KClass type.

Return

true if the declaration has parents of all the specified KClass types, false otherwise.

Parameters

names

the KClass types of the parents to check.

indirectParents

specifies whether to include parents defined in other files such as parent of the parent. If true, it includes only those parents defined within our scope and those used by our declarations. For example:

// Android
class AppCompactActivity: Activity
interface Activity

// Project
class BaseActivity: AppCompactActivity() // parents(indirectParents = true) returns [AppCompactActivity]
class MyActivity: BaseActivity() // parents(indirectParents = true) returns [BaseActivity, AppCompactActivity]