All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.jpattern.core.util.CollectionUtil Maven / Gradle / Ivy

There is a newer version: 3.6.2
Show newest version
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 aList) {
		return aList.toArray( (T[]) Array.newInstance(aClass, aList.size()) );
	}
	
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy