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

com.thomas.alib.excel.utils.CollectionUtils Maven / Gradle / Ivy

package com.thomas.alib.excel.utils;


import java.util.Collection;
import java.util.Map;

/**
 * 集合工具
 */
public class CollectionUtils {

    /**
     * 集合是否为空
     *
     * @param collection 集合对象
     * @return 是否为空
     */
    public static boolean isEmpty(Collection collection) {
        return collection == null || collection.isEmpty();
    }

    /**
     * Map是否为空
     *
     * @param map map对象
     * @return 是否为空
     */
    public static boolean isEmpty(Map map) {
        return map == null || map.isEmpty();
    }

    /**
     * 集合是否不为空
     *
     * @param collection 集合对象
     * @return 是否不为空
     */
    public static boolean isNotEmpty(Collection collection) {
        return !isEmpty(collection);
    }

    /**
     * Map是否不为空
     *
     * @param map map对象
     * @return 是否不为空
     */
    public static boolean isNotEmpty(Map map) {
        return !isEmpty(map);
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy