Java Collection Contain containsAssignableClass( Collection> clses, Class clazz)

Here you can find the source of containsAssignableClass( Collection> clses, Class clazz)

Description

contains Assignable Class

License

Apache License

Declaration

public static boolean containsAssignableClass(
        Collection<Class<?>> clses, Class<?> clazz) 

Method Source Code

//package com.java2s;
//License from project: Apache License 

import java.util.Collection;

public class Main {

    public static boolean containsAssignableClass(
            Collection<Class<?>> clses, Class<?> clazz) {
        for (Class<?> cls : clses) {
            if (cls.isAssignableFrom(clazz)) {
                return true;
            }/*from ww  w.  j  a va2 s.  c  om*/
        }
        return false;
    }

    public static boolean containsAssignableClass(Class<?>[] clses,
            Class<?> clazz) {
        for (Class<?> cls : clses) {
            if (cls.isAssignableFrom(clazz)) {
                return true;
            }
        }
        return false;
    }
}

Related

  1. containsAny(final Collection a, final Collection b)
  2. containsAnyIgnoreCase(String string, Collection searchStrings)
  3. containsAnyNull(Collection source)
  4. containsAnyOf(String s, Collection values)
  5. containsAnyVariables(Collection propertyValues)
  6. containsAtLeastOne(Collection origin, Collection elements)
  7. containsAtleastOne(Collection left, Collection right)
  8. containsByClassName(Collection objects, String className)
  9. containsByIdentity(Collection collection, Object toBeFound)