Java Collection Check isCollection(Class clazz)

Here you can find the source of isCollection(Class clazz)

Description

Judge whether class is collection

License

Open Source License

Parameter

Parameter Description
clazz a parameter

Declaration

public static boolean isCollection(Class<?> clazz) 

Method Source Code

//package com.java2s;

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

public class Main {
    /**/*from ww w  . ja v a  2  s  .  com*/
     * Judge whether class is collection
     * 
     * @param clazz
     * @return
     */
    public static boolean isCollection(Class<?> clazz) {
        return clazz.isAssignableFrom(List.class) || clazz.isAssignableFrom(Set.class)
                || clazz.isAssignableFrom(Collection.class);
    }
}

Related

  1. isC2InC1(Collection c1, Collection c2)
  2. isClassCollection(Class c)
  3. isClassCollection(Class c)
  4. isClassCollection(Class type)
  5. isCollection(Class c)
  6. isCollection(Class clazz)
  7. isCollection(Class clazz)
  8. isCollection(Class klass)
  9. isCollection(Class type)