hasAllExternalParents

abstract fun hasAllExternalParents(indirectParents: Boolean = false, predicate: (KoParentDeclaration) -> Boolean): Boolean

Determines whether the declaration has all external parents that satisfy the provided predicate.

Note that if the external parents contains no elements, the function returns true because there are no elements in it that do not match the predicate.

Return

true if all external parents satisfy the predicate, false otherwise.

Parameters

indirectParents

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

// Android
class AppCompactActivity: Activity
interface Activity

// Project
class BaseActivity: AppCompactActivity() // externalParents(indirectParents = true) returns [AppCompactActivity]
class MyActivity: BaseActivity() // externalParents(indirectParents = true) returns [AppCompactActivity]
predicate

A function that defines the condition to be met by external parents.