getNestedInstances

fun <R : Any> getNestedInstances(clazz: KClass<*>, baseInstance: Any, curDepth: Int = 0, maxDepth: Int = 9): Flow<R>

Gets all instances of R by traversing the given class and all of its nested classes.

Return

A flow of instances of R.

Parameters

baseInstance

The starting instance.

curDepth

The current search depth.

maxDepth

The maximum search depth.

R

The instance type to find.