List 1 determines whether the parent class or parent interface, subclasses, and so on itself
/** * List is determined whether the specified class or subclass parent * * @Param clz * @return */ public static boolean isListTypeClass(Class clz) { try { return List.class.isAssignableFrom(clz) || clz.newInstance() instanceof List; } catch (Exception e) { return false; } }
2. Determine if the specified class is an array type
/** * Determines whether the specified class is an array * * @Param clz * @return */ public static boolean isArrayTypeClass(Class clz) { return clz.isArray(); }