gradle
8.3

# flattenCollections

open fun flattenCollections(things: Array<Any>): List<out Any>

Recursively unpacks all the given things into a flat list. Nulls are not removed, they are left intact.

#### Return

A flattened list of the given things

#### Parameters

things

The things to flatten

open fun <T> flattenCollections(type: Class<T>, things: Array<Any>): List<T>

Recursively unpacks all the given things into a flat list, ensuring they are of a certain type. Nulls are not removed, they are left intact. If a non null object cannot be cast to the target type, a ClassCastException will be thrown.

#### Return

A flattened list of the given things

#### Parameters

things

The things to flatten

<T>

The target type in the flattened list