spring-framework / org.springframework.util / CollectionUtils / arrayToList

arrayToList

open static fun arrayToList(@Nullable source: Any): MutableList<Any?>

Convert the supplied array into a List. A primitive array gets converted into a List of the appropriate wrapper type.

NOTE: Generally prefer the standard Arrays#asList method. This arrayToList method is just meant to deal with an incoming Object value that might be an Object[] or a primitive array at runtime.

A null source value will be converted to an empty List.

Parameters

source - the (potentially primitive) array

Return
the converted List result

See Also
ObjectUtils#toObjectArray(Object)Arrays#asList(Object[])