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

win.hupubao.common.utils.ListUtils Maven / Gradle / Ivy

Go to download

简单封装公共工具,二维码工具,驼峰转换工具,des加解密工具,http访问工具,字符串工具,日期工具

There is a newer version: 2.0.4
Show newest version
package win.hupubao.common.utils;

import java.util.Collection;
import java.util.List;

/**
 * @author Moses
 * @date 2017-08-30
 */
public class ListUtils {

    /**
     * list包含collection中任意一个
     * @param list
     * @param collection
     * @return
     */
    public static boolean containsAny(List list,
                                      Collection collection){
        if (list == null
                || list.isEmpty()) {
            return false;
        }

        if (!collection.getClass().equals(list.get(0).getClass())){
            return false;
        }

        for (Object object :
                list) {
            if (collection.contains(object)) {
                return true;
            }
        }
        return false;
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy