hasParentClass

abstract fun hasParentClass(): Boolean

Determines whether declaration has a direct parent class.

Return

true if the declaration has any direct parent class, false otherwise.


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

Determines whether the declaration has a specified parent class. If indirectParents is set to true, it verifies if there's at least one parent class that satisfies the provided predicate.

Return

true if there is a matching declaration, false otherwise.

Parameters

indirectParents

specifies whether to include parent classes defined in other files such as parent of the parent.

predicate

A function that defines the condition to be met by a parent class.