com.jpattern.core.util.CollectionUtil Maven / Gradle / Ivy
package com.jpattern.core.util;
import java.lang.reflect.Array;
import java.util.Arrays;
import java.util.Collection;
import java.util.List;
/**
*
* @author Francesco Cina' 14/dic/2010 - 15.13.02
* @version $Id$
*
*/
public abstract class CollectionUtil {
public static List toList(T[] aArray) {
return Arrays.asList(aArray);
}
@SuppressWarnings("unchecked")
public static T[] toArray(Class aClass, Collection extends T> aList) {
return aList.toArray( (T[]) Array.newInstance(aClass, aList.size()) );
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy