Java Collection Contain containsSafe(Collection collection, V value)

Here you can find the source of containsSafe(Collection collection, V value)

Description

Type-safe wrapper for Collection#contains(Object) method.

License

Open Source License

Declaration

public static <V> boolean containsSafe(Collection<V> collection, V value) 

Method Source Code

//package com.java2s;
// under the terms of the Eclipse Public License v1.0 which accompanies

import java.util.Collection;

public class Main {
    /**/* w  w  w  .j  a va  2  s  .  c om*/
     * Type-safe wrapper for {@link Collection#contains(Object)} method. It restricts
     * type of a value and makes sure that you do not call method for the value
     * wrong type.
     */
    public static <V> boolean containsSafe(Collection<V> collection, V value) {
        return collection.contains(value);
    }
}

Related

  1. containsObject(Collection c, T o)
  2. containsObjectIdentity(Collection collection, Object object)
  3. containsOne(final Collection sup, final Collection parts)
  4. containsPrefix(final Collection words, final String prefix)
  5. containsPrefix(String str, Collection prefixes)
  6. containsSame(Collection first, Collection second)
  7. containsSameItems(Collection col1, Collection col2)
  8. containsSameType(Object o, Collection collection)
  9. containsSome(Collection source, Collection target)