com.bmuschko.gradle.docker.utils.CollectionUtil.groovy Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of gradle-docker-plugin Show documentation
Show all versions of gradle-docker-plugin Show documentation
Gradle plugin for managing Docker images and containers.
package com.bmuschko.gradle.docker.utils
import java.lang.reflect.Array
final class CollectionUtil {
private CollectionUtil() { }
static Object[] toArray(List list) {
if (list == null) {
return new Object[0]
}
Class clazz = list[0].getClass()
list.toArray(Array.newInstance(clazz, 0))
}
}