kbox-android / ch.tutteli.kbox / varargToList

varargToList

fun <T> varargToList(arg: T, otherArgs: Array<out T>): List<T>

Adds the given arg and the otherArgs into a new List and returns it.

This function is intended for API functions which expect x: T, vararg otherX: T and want to pass the arguments to another function which expects only one argument of List<T>.

Return
a List containing arg and otherArgs.