hasParents

abstract fun hasParents(indirectParents: Boolean = false): Boolean

Determines whatever declaration has any parent (parent class and parent interfaces).

Return

true if the declaration has any parent, false otherwise.

Parameters

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]