Java Collection Contain containsElement(Collection collect, T elem)

Here you can find the source of containsElement(Collection collect, T elem)

Description

contains Element

License

Open Source License

Declaration

public static <T> boolean containsElement(Collection<T> collect, T elem) 

Method Source Code

//package com.java2s;

import java.util.Collection;

import java.util.Map;

public class Main {
    public static <T> boolean containsElement(Collection<T> collect, T elem) {
        if (elem == null || isEmpty(collect)) {
            return false;
        }//from   w  ww .j a v a  2  s . com
        return collect.contains(elem);
    }

    public static <T> boolean isEmpty(Collection<T> collect) {
        return collect == null || collect.isEmpty();
    }

    public static <K, V> boolean isEmpty(Map<K, V> map) {
        return map == null || map.isEmpty();
    }
}

Related

  1. containsAtLeastOne(Collection origin, Collection elements)
  2. containsAtleastOne(Collection left, Collection right)
  3. containsByClassName(Collection objects, String className)
  4. containsByIdentity(Collection collection, Object toBeFound)
  5. containsClassOrSuper(Collection classNames, String className)
  6. containsIdentity(Collection collection, T element)
  7. containsIdentity(Collection objects, Object object)
  8. containsIgnoreCase(Collection c, String s)
  9. containsIgnoreCase(Collection c, String s)