Java Collection Contain contains( C collection, K key)

Here you can find the source of contains( C collection, K key)

Description

Type-safe contains

License

Open Source License

Parameter

Parameter Description
map a parameter
key a parameter

Return

value

Declaration

public static <K, C extends Collection<K>> boolean contains(
        C collection, K key) 

Method Source Code

//package com.java2s;

import java.util.Collection;

public class Main {
    /**/*from w  w  w  . j  a  va2s . c om*/
     * Type-safe contains
     * @param map
     * @param key
     * @return value
     */
    public static <K, C extends Collection<K>> boolean contains(
            C collection, K key) {
        return collection.contains(key);
    }
}

Related

  1. contains(Collection c, Object o, Comparator comparator)
  2. contains(Collection coll, Object o, Comparator c)
  3. contains(Collection collection, Object object)
  4. contains(Collection objects, Object o)