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

com.github.alittlehuang.data.util.CollectionUtils Maven / Gradle / Ivy

package com.github.alittlehuang.data.util;

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


/**
 * @author ALittleHuang
 */
public abstract class CollectionUtils {

    /**
     * Return {@code true} if the supplied Collection is {@code null} or empty.
     * Otherwise, return {@code false}.
     *
     * @param collection the Collection to check
     * @return whether the given Collection is empty
     */
    public static boolean isEmpty(Collection collection) {
        return ( collection == null || collection.isEmpty() );
    }

    /**
     * Return {@code true} if the supplied Map is {@code null} or empty.
     * Otherwise, return {@code false}.
     *
     * @param map the Map to check
     * @return whether the given Map is empty
     */
    public static boolean isEmpty(Map map) {
        return ( map == null || map.isEmpty() );
    }

}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy