org.iartisan.runtime.utils.CollectionUtil Maven / Gradle / Ivy
package org.iartisan.runtime.utils;
import java.util.Collection;
import java.util.Map;
/**
*
* 集合 utils
*
* @author King
* @since 2018/2/7
*/
public class CollectionUtil {
public static boolean isEmpty(Collection collection) {
if (null == collection) {
return true;
}
return collection.isEmpty();
}
public static boolean isNotEmpty(Collection collection) {
return !isEmpty(collection);
}
/**
* 判断Map是否为空
*
* @param map
* @return
*/
public static boolean isEmpty(Map, ?> map) {
return (map == null || map.isEmpty());
}
/**
* 判断Map是否不为空
*
* @param map
* @return
*/
public static boolean isNotEmpty(Map, ?> map) {
return !isEmpty(map);
}
}