cn.cliveyuan.robin.generator.util.CollectionUtils Maven / Gradle / Ivy
package cn.cliveyuan.robin.generator.util;
import java.util.Arrays;
import java.util.Collection;
import java.util.List;
/**
* @author Clive Yuan
* @date 2020/12/24
*/
public class CollectionUtils {
public static List listOf(E... elements) {
checkNotNull(elements);
return Arrays.asList(elements);
}
private static T checkNotNull(T reference) {
if (reference == null) {
throw new NullPointerException();
}
return reference;
}
public static boolean isEmpty(final Collection> coll) {
return coll == null || coll.isEmpty();
}
public static boolean isNotEmpty(final Collection> coll) {
return !isEmpty(coll);
}
}