Here you can find the source of isCollection(Class> clazz)
Parameter | Description |
---|---|
clazz | a parameter |
public static boolean isCollection(Class<?> clazz)
//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); } }