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

com.qa.framework.library.base.CollectionHelper Maven / Gradle / Ivy

There is a newer version: 2.5
Show newest version
package com.qa.framework.library.base;

import org.apache.commons.collections.CollectionUtils;
import org.apache.commons.collections.MapUtils;

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

/**
 * Created by kcgw001 on 2016/3/31.
 */
public class CollectionHelper {
    /**
     * 判断 Collection 是否为空
     *
     * @param collection the collection
     * @return the boolean
     */
    public static boolean isEmpty(Collection collection) {
        return CollectionUtils.isEmpty(collection);
    }

    /**
     * 判断 Collection 是否非空
     *
     * @param collection the collection
     * @return the boolean
     */
    public static boolean isNotEmpty(Collection collection) {
        return !isEmpty(collection);
    }

    /**
     * 判断 Map 是否为空
     *
     * @param map the map
     * @return the boolean
     */
    public static boolean isEmpty(Map map) {
        return MapUtils.isEmpty(map);
    }

    /**
     * 判断 Map 是否非空
     *
     * @param map the map
     * @return the boolean
     */
    public static boolean isNotEmpty(Map map) {
        return !isEmpty(map);
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy